Quantcast
Channel: naudio Work Item Rss Feed
Viewing all articles
Browse latest Browse all 738

Closed Issue: [MMException] WaveStillPlaying [9067]

$
0
0
I'm developing a windows service that plays mp3's using Naudio.
The service plays mp3's when particular events occurs.
Service works fine for 20 - 30 minutes but randomly I get a MMEXception.WaveStillPlaying ( or InvalidOperationException ) Exception that i'm not able to catch.
I'm using Nadio Beta Release [ 1.2 ] ( also I try to use the latest source code available but the problem persists )
I perform the following operations to play mp3's :
/******* C# CODE ***************/
NAudio.Wave.WaveOut wout1 = new NAudio.Wave.WaveOut(0, 200, false);
NAudio.Wave.WaveStream mp3_reader1 = new NAudio.Wave.Mp3FileReader(files[0]);
NAudio.Wave.WaveStream mp32wavConverter1 = NAudio.Wave.WaveFormatConversionStream.CreatePcmStream(mp3_reader1);
NAudio.Wave.WaveStream wout_src1 = new NAudio.Wave.BlockAlignReductionStream(mp32wavConverter1);
wout1.Init(wout_src1);
wout1.Play();
/****************************************/
i dispose objects to play another mp3 after ( wout_src1.TotalTime.Seconds * 1000 + wout_src1.TotalTime.Minutes * 60 * 1000 + wout_src1.TotalTime.Milliseconds + 200 ) ms , in the following way
/****** C# CODE **********************/
if (wout1 != null)
{

try
{
wout1.Stop();
}
catch (NAudio.MmException e)
{ // ... //
}
}

if (wout_src1 != null)
{
try
{
wout_src1.Close();
}
catch (NAudio.MmException e)
{ // ... //
}
try
{
wout_src1.Dispose();
}
catch (NAudio.MmException e)
{ // ... //
}
wout_src1 = null;
}

if (mp32wavConverter1 != null)
{
try
{
mp32wavConverter1.Close();
}
catch (NAudio.MmException e)
{ // ... //
}
try
{
mp32wavConverter1.Dispose();
}
catch (NAudio.MmException e)
{ // ... //
}
mp32wavConverter1 = null;
}

if (mp3_reader1 != null)
{
try
{
mp3_reader1.Close();
}
catch (NAudio.MmException e)
{ // ... //
}
try
{
mp3_reader1.Dispose();
}
catch (NAudio.MmException e)
{ // ... //
}
mp3_reader1 = null;
}

if (wout1 != null)
{
try
{
wout1.Dispose();
}
catch (NAudio.MmException e)
{ // ... //
}
wout1 = null;
}
/*********************************/

Using Naudio latest source code in Debug Mode i get the following error:


System.InvalidOperationException non è stata gestita
Message="Handle non inizializzato."
Source="mscorlib"
StackTrace:
in System.Runtime.InteropServices.GCHandle.FromIntPtr(IntPtr value)
in System.Runtime.InteropServices.GCHandle.op_Explicit(IntPtr value)
in NAudio.Wave.WaveOut.Callback(IntPtr hWaveOut, WaveOutMessage uMsg, Int32 dwUser, WaveHeader wavhdr, Int32 dwReserved) in C:\Documents and Settings\Simo\Documenti\Visual Studio 2008\Funicolari\naudio-24573\NAudio\Wave\WaveOutputs\WaveOut.cs:riga 285
InnerException:



private void Callback(IntPtr hWaveOut, WaveInterop.WaveOutMessage uMsg, Int32 dwUser, WaveHeader wavhdr, int dwReserved)
uMsg = Done
dwUSer = 0
wavhdr ={NAudio.Wave.WaveHeader}
dwReserved = 0
Comments: this should be fixed in the latest NAudio now

Viewing all articles
Browse latest Browse all 738

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>