tag:blogger.com,1999:blog-20861261.post3123215497784708991..comments2023-09-01T01:59:34.240-07:00Comments on OpenSebJ by DSebJ: Introduction to Using NAudioOpenSebJhttp://www.blogger.com/profile/05952655132453138298noreply@blogger.comBlogger7125tag:blogger.com,1999:blog-20861261.post-41404983269908974702015-12-10T12:23:33.137-08:002015-12-10T12:23:33.137-08:00Thanks!
I"VE MADE LOOPS!!
waveOutDevice.Pl...Thanks! <br />I"VE MADE LOOPS!!<br /><br /> waveOutDevice.Play();<br /> while (true)<br /> {<br /> if (mainOutputStream.Position == mainOutputStream.Length)<br /> {<br /> mainOutputStream.CurrentTime = TimeSpan.FromSeconds(0);<br /> waveOutDevice.Play();<br /> }<br /> }Laserbeak43https://www.blogger.com/profile/15423022758505174926noreply@blogger.comtag:blogger.com,1999:blog-20861261.post-18735395510074671342012-05-10T13:13:17.484-07:002012-05-10T13:13:17.484-07:00Thank you so much for creating this blog. I decid...Thank you so much for creating this blog. I decided to create an audio application for one of my classes, and had no idea where to start. You're a life saver!Rescuednoreply@blogger.comtag:blogger.com,1999:blog-20861261.post-9347792102057006052011-09-25T05:37:55.160-07:002011-09-25T05:37:55.160-07:00missed two lines at the beginning. insert this in ...missed two lines at the beginning. insert this in front of the other stuff:<br /> IWavePlayer ^outDevice;<br /> WaveStream ^outStream;Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-20861261.post-83709078528346129082011-09-25T05:27:24.842-07:002011-09-25T05:27:24.842-07:00thx for the tutorial. it was really helpful to get...thx for the tutorial. it was really helpful to get me started using the library with c++/cli. i somewhat adapted the code though for my needs. maybe helpful for those wanting to code within managed c++ evironment.<br /> // create waveOut-device<br /> try { <br /> outDevice = gcnew DirectSoundOut(); <br /> }<br /> catch (Object ^error) { // oops! :D<br /> MessageBox::Show(Convert::ToString(error));<br /> return;<br /> }<br /><br /> // get a file name to play back<br /> OpenFileDialog ^openDlg = gcnew OpenFileDialog();<br /> openDlg->Filter = "Wave Files (*.wav)|*.wav|All Files (*.*)|*.*";<br /> openDlg->FilterIndex = 1;<br /> if (openDlg->ShowDialog() != System::Windows::Forms::DialogResult::OK) {<br /> MessageBox::Show("Open Error");<br /> return;<br /> }<br /><br /> // create a wave-stream from file<br /> outStream = CreateInputStream(openDlg->FileName);<br /> try { <br /> outDevice->Init(outStream);<br /> }<br /> catch (Object ^error) {<br /> MessageBox::Show(Convert::ToString(error));<br /> return;<br /> }<br /><br /> // play wave<br /> outDevice->Play();<br /> <br />}<br />// CREATE A WAVE STREAM FROM FILE NAME<br />private: WaveStream ^CreateInputStream(String ^ fileName) {<br /> WaveChannel32 ^inputStream;<br /><br /> if ((fileName->ToLower())->EndsWith(".wav")) { // if filename has .wav-extension<br /><br /> // create stream<br /> WaveStream ^readerStream = gcnew WaveFileReader(fileName);<br /><br /> // check if encoding is pcm: if not convert<br /> if (readerStream->WaveFormat->Encoding != WaveFormatEncoding::Pcm) {<br /> readerStream = WaveFormatConversionStream::CreatePcmStream(readerStream);<br /> readerStream = gcnew BlockAlignReductionStream(readerStream);<br /> }<br /> // check if it's 16bit-resolution: if not convert<br /> if (readerStream->WaveFormat->BitsPerSample != 16) {<br /> WaveFormat ^format = gcnew WaveFormat(readerStream->WaveFormat->SampleRate,<br /> 16, readerStream->WaveFormat->Channels);<br /> readerStream = gcnew WaveFormatConversionStream(format, readerStream);<br /> }<br /> inputStream = gcnew WaveChannel32(readerStream);<br /> }<br /> if (inputStream != nullptr) return inputStream;<br /> else return nullptr; <br />}Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-20861261.post-4019383847929352102011-06-30T12:45:12.226-07:002011-06-30T12:45:12.226-07:00Hi!
I like so much your examples. I find them ver...Hi!<br /><br />I like so much your examples. I find them very interesting...<br /><br />I have a question. I have my laptop with his own sound card device and I have another USB sound card.<br /><br />How can I play 2 mp3 (one of them by the Internal Sound Card and the other by the USB sound card?<br /><br />I tried to do it, but I'm unable to do itSergihttps://www.blogger.com/profile/08185785450693596611noreply@blogger.comtag:blogger.com,1999:blog-20861261.post-66723285481440518612011-05-14T21:33:03.705-07:002011-05-14T21:33:03.705-07:00Great Articles , :)Great Articles , :)PGiZnoreply@blogger.comtag:blogger.com,1999:blog-20861261.post-48637762731920994922011-02-21T10:07:33.231-08:002011-02-21T10:07:33.231-08:00thanks providing a tutorialthanks providing a tutorialUnknownhttps://www.blogger.com/profile/04496900312446724209noreply@blogger.com