<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to play Windows WAV sound with JSL? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-play-Windows-WAV-sound-with-JSL/m-p/510670#M73846</link>
    <description>&lt;UL&gt;&lt;LI&gt;&lt;P class=""&gt;I write the code like this and it automatically shuts down without success.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;RunProgram( executable( "C:\Program Files\Windows Media Player\wmplayer.exe" ), options( {"C:\Windows\Media\tada.wav"} ) );
Wait( 3 );
RunProgram( executable( "cmd.exe" ), options( {"/c Taskkill /im wmplayer.exe /f /t"} ) );&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 17 Jun 2022 07:14:27 GMT</pubDate>
    <dc:creator>lala</dc:creator>
    <dc:date>2022-06-17T07:14:27Z</dc:date>
    <item>
      <title>How to play Windows WAV sound with JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-play-Windows-WAV-sound-with-JSL/m-p/510663#M73843</link>
      <description>&lt;P&gt;Can I not use this command?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;run program(executable(""),options({""}))&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;audio files&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;C:\Windows\Media\tada.wav&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 17:01:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-play-Windows-WAV-sound-with-JSL/m-p/510663#M73843</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2023-06-09T17:01:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to play Windows WAV sound with JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-play-Windows-WAV-sound-with-JSL/m-p/510670#M73846</link>
      <description>&lt;UL&gt;&lt;LI&gt;&lt;P class=""&gt;I write the code like this and it automatically shuts down without success.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;RunProgram( executable( "C:\Program Files\Windows Media Player\wmplayer.exe" ), options( {"C:\Windows\Media\tada.wav"} ) );
Wait( 3 );
RunProgram( executable( "cmd.exe" ), options( {"/c Taskkill /im wmplayer.exe /f /t"} ) );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 17 Jun 2022 07:14:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-play-Windows-WAV-sound-with-JSL/m-p/510670#M73846</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2022-06-17T07:14:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to play Windows WAV sound with JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-play-Windows-WAV-sound-with-JSL/m-p/510671#M73847</link>
      <description>&lt;P&gt;&lt;SPAN&gt;AutoHotkey can play this file like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;SoundPlay, %A_WinDir%\Media\tada.wav
Sleep 2000&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 17 Jun 2022 07:16:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-play-Windows-WAV-sound-with-JSL/m-p/510671#M73847</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2022-06-17T07:16:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to play Windows WAV sound with JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-play-Windows-WAV-sound-with-JSL/m-p/510765#M73883</link>
      <description>&lt;P&gt;I am not sure that JMP can do that. I vaguely remembered JMP can play midi. But if anyone has the experience about this, I would think of&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/982"&gt;@Craige_Hales&lt;/a&gt;&amp;nbsp;. Why don't you first check out his post&amp;nbsp;&lt;A href="https://community.jmp.com/t5/Uncharted/Working-with-WAV-files/ba-p/29469" target="_self"&gt;Working with WAV files&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Even if his post might not have said how to play a WAV file, you may trace his work to find out how to deal with windows DLL. It seems possible to use WINMM.DLL to play WAV; see &lt;A href="https://www.codeproject.com/Articles/6543/Playing-WAV-files-using-the-Windows-Multi-Media-Li" target="_self"&gt;here&lt;/A&gt;&amp;nbsp;(though might be out-dated.)&lt;/P&gt;</description>
      <pubDate>Sun, 19 Jun 2022 01:49:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-play-Windows-WAV-sound-with-JSL/m-p/510765#M73883</guid>
      <dc:creator>peng_liu</dc:creator>
      <dc:date>2022-06-19T01:49:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to play Windows WAV sound with JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-play-Windows-WAV-sound-with-JSL/m-p/510766#M73884</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Thanks for the tip!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 19 Jun 2022 03:13:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-play-Windows-WAV-sound-with-JSL/m-p/510766#M73884</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2022-06-19T03:13:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to play Windows WAV sound with JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-play-Windows-WAV-sound-with-JSL/m-p/510771#M73887</link>
      <description>&lt;P&gt;&lt;LI-MESSAGE title="Audio Note in an Envelope" uid="282011" url="https://community.jmp.com/t5/Uncharted/Audio-Note-in-an-Envelope/m-p/282011#U282011" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-blog-thread lia-fa-icon lia-fa-blog lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp; uses&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;	If( playFromMemory &amp;amp; useSoundPlayer, // from memory
		mmdll &amp;lt;&amp;lt; PlaySoundA( Blob To Matrix( riffblob, "float", 8, "native" ), 0, 5 )//
	, // else via file
		filename = Save Text File( "$desktop/note.wav", riffblob );
		If( useSoundPlayer,
			mmdll &amp;lt;&amp;lt; PlaySoundA(
				Blob To Matrix( Char To Blob( filename ) || Matrix To Blob( [0, 0, 0, 0, 0, 0, 0, 0, 0], "int", 1, "little" ), "float", 8, "native" ),
				0,
				131073
			)
		);
	);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;the PlaySoundA entrypoint in the DLL can't overlap audio files and is a bit arcane and needs a bit of setup.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;LI-MESSAGE title="Plucked note synthesis" uid="105063" url="https://community.jmp.com/t5/Uncharted/Plucked-note-synthesis/m-p/105063#U105063" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-blog-thread lia-fa-icon lia-fa-blog lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp; and &lt;LI-MESSAGE title="Mandelbrot Sound" uid="105804" url="https://community.jmp.com/t5/Uncharted/Mandelbrot-Sound/m-p/105804#U105804" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-blog-thread lia-fa-icon lia-fa-blog lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp; use &lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;wavname = RiffUtil:WavWriter( "$temp/rotate.wav", bigbuf ); 
Open( wavname );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and &lt;LI-MESSAGE title="Midi (music) File Editor" uid="21926" url="https://community.jmp.com/t5/JMP-Add-Ins/Midi-music-File-Editor/m-p/21926#U21926" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-tkb-thread lia-fa-icon lia-fa-tkb lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp; is similar, Open( temp ), for a .mid file extension. Open() opens the built in player. The midi player example uses two files because the open player keeps the other one in use.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;LI-MESSAGE title="Using a Project for a Project" uid="381632" url="https://community.jmp.com/t5/Uncharted/Using-a-Project-for-a-Project/m-p/381632#U381632" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-blog-thread lia-fa-icon lia-fa-blog lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp; uses (This is the best way to play overlapping sound files.)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;pgm = Eval Insert( "(New-Object Media.SoundPlayer \!"^filename^\!").PlaySync();" );
			//write("\!npowershell ",pgm);
			Insert Into(Audio:rphandles,
				Run Program( executable( "powershell" ), options( {"-c", pgm} ), readfunction( Function( {this}, Write( this &amp;lt;&amp;lt; read ) ) ) )
			);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This project is a side-scroller game with a rich sound tapestry to enhance the ambiance...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;LI-MESSAGE title="Pumpkin Rush" uid="21888" url="https://community.jmp.com/t5/JMP-Add-Ins/Pumpkin-Rush/m-p/21888#U21888" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-tkb-thread lia-fa-icon lia-fa-tkb lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp; uses the built-in speech function to make an ooomph! sound. (This, and the beep function, are easy but not very flexible.) Another game. Beware the shaking screen!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;LI-MESSAGE title="Working with WAV files" uid="29469" url="https://community.jmp.com/t5/Uncharted/Working-with-WAV-files/m-p/29469#U29469" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-blog-thread lia-fa-icon lia-fa-blog lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp; appears to write a file to disk but not actually play it. Wav files have a modestly complex format to hold a set of samples (mono, stereo, 48 ... 8 kHz, ...)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As much as I love audio, I was never able to justify spending time adding audio support to a statistics package. If you have a great use-case, add it here!&lt;/P&gt;</description>
      <pubDate>Sun, 19 Jun 2022 11:44:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-play-Windows-WAV-sound-with-JSL/m-p/510771#M73887</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2022-06-19T11:44:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to play Windows WAV sound with JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-play-Windows-WAV-sound-with-JSL/m-p/510772#M73888</link>
      <description>&lt;P&gt;Thank Craige!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;The reason I wanted JSL to play the audio was simple: to use JSL to play the sound to remind when the data conditions of the data sheet are specified.&lt;/SPAN&gt;&lt;SPAN class=""&gt;The simplest way to implement the alert will do.Thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 19 Jun 2022 12:21:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-play-Windows-WAV-sound-with-JSL/m-p/510772#M73888</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2022-06-19T12:21:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to play Windows WAV sound with JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-play-Windows-WAV-sound-with-JSL/m-p/510773#M73889</link>
      <description>&lt;P&gt;this might be all you need&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;beep( );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You might be able to use&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;speak("Ready!")&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;but I don't know how to localize it to a language other than English. You can make it say some random sounds.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;speak("aeiou");&amp;nbsp;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It will use a different voice/algorithm on different computers/OSs/versions...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 19 Jun 2022 16:37:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-play-Windows-WAV-sound-with-JSL/m-p/510773#M73889</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2022-06-19T16:37:31Z</dc:date>
    </item>
  </channel>
</rss>

