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

Created Unassigned: WASAPI interface implementation [16445]

$
0
0
Hi,

Is there any plans to implement below interfaces?



Thanks

Edited Unassigned: WASAPI interface implementation [16445]

$
0
0
Hi,

I'm working on project which need to handle active/ deactive session states.
Is there any plans to implement below interfaces?
AudioSessionControl2
AudioSessionManager2

Thanks

Commented Unassigned: Not available for Windows Phone 8 projects? [16444]

$
0
0
Trying to create a universal Windows 8/WP8 app, but I can't add Naudio package to WP8.1 project.
Is WP8 unsupported? Will it be supported anytime soon?
Comments: See http://social.msdn.microsoft.com/Forums/de-DE/92974f6b-2b44-4586-912e-b9cebb3ef18b/works-the-wasapi-interface-under-phone-81-under-c?forum=wpdevelop

Commented Unassigned: Not available for Windows Phone 8 projects? [16444]

$
0
0
Trying to create a universal Windows 8/WP8 app, but I can't add Naudio package to WP8.1 project.
Is WP8 unsupported? Will it be supported anytime soon?
Comments: I'd love to add WP8.1 support, but time is limited at the moment. Hopefully it will be easier now that we've added WinStore support as I understand that the WP8.1 API is getting much closer to the Windows Store one.

Commented Unassigned: WASAPI interface implementation [16445]

$
0
0
Hi,

I'm working on project which need to handle active/ deactive session states.
Is there any plans to implement below interfaces?
AudioSessionControl2
AudioSessionManager2

Thanks
Comments: No immediate plans, but it would be good to get them in at some point. Feel free to add them and issue a pull request.

Created Unassigned: Audio path permanently lost to instance of an application [16446]

$
0
0
I am building a Windows Forms application that uses NAUDIO to record / play audio tracks.

During testing on Windows 7 we disabled all input devices (mics) and tried to record some audio.

There was a path through the code that attempted to record via the default input in WaveIn mode.

"An unhandled exception of type 'NAudio.MmException' occured in NAudio.dll
Aditional information: BadDeviceId calling waveInOpen

NAudio.MmException was unhandled
HResult=-2146233088
Message=BadDeviceId calling waveInOpen
Source=NAudio
StackTrace:
at NAudio.MmException.Try(MmResult result, String function) in c:\Users\mike\Documents\CSharp\CommonProjects\NAudio\Wave\MmeInterop\MmException.cs:line 40
at NAudio.Wave.WaveIn.OpenWaveInDevice() in c:\Users\mike\Documents\CSharp\CommonProjects\NAudio\Wave\WaveInputs\WaveIn.cs:line 185
at NAudio.Wave.WaveIn.StartRecording() in c:\Users\mike\Documents\CSharp\CommonProjects\NAudio\Wave\WaveInputs\WaveIn.cs:line 198
at xxxxxxxxxxClient.Announcements.MicRecordingControl.OnBtnRecordClick(Object sender, EventArgs e) in c:\Users\mike\Documents\CSharp\Applications\xxxxxxxxxxClient\xxxxxxxxxxClient\Announcements\MicRecordingControl.cs:line 237
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at xxxxxxxxxxClient.CPU.Run() in c:\Users\mike\Documents\CSharp\Applications\xxxxxxxxxxClient\xxxxxxxxxxClient\CPU.cs:line 83
at xxxxxxxxxxClient.Program.Main(String[] args) in c:\Users\mike\Documents\CSharp\Applications\xxxxxxxxxxClient\xxxxxxxxxxClient\Program.cs:line 27
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:

Subsequently - if the application is restarted it will no longer play audio! Even if it is pre-recorded.

The Windows Audio Mixer shows audio at the input but nothing at the output, while other inputs (applications) continue to function normally.

Even a reboot of the computer will not clear the problem.

Installing a new copy of the application will resolve the problem i.e. the new install works but the previous install continues to fail.

I tried adding a mic back to the system and recording audio again from the failed application instance. This appears to have recovered the application.

My question - is this a known behaviour of Windows 7? Is there a workaround or other solution that avoids reinstall or having to install a mic and attempt to record again from the same application?

(Obviously I will eliminate the path through the code as well...)


Created Unassigned: access to microphone properties/enhancement programmatically [16447]

$
0
0


hi,

can anyone tell me house to access the windows microphone properties/enhancements programmatically,
can it be access through MIXERLINECONTROL


thanks

Commented Unassigned: Occasional AccessViolation in WDMAUD.DRV [16396]

$
0
0
Under load, I am getting an occasional AccessViolation in WDMAUD.DRV, and my application is crashing.

Comments: I've checked your suggested fix in, will be released shortly

Commented Unassigned: access to microphone properties/enhancement programmatically [16447]

$
0
0


hi,

can anyone tell me house to access the windows microphone properties/enhancements programmatically,
can it be access through MIXERLINECONTROL


thanks
Comments: hi, yes the mixer APIs ought to be able to find this control, but in practice it can be very hard to do. Easiest thing is just to experiment with the mixer API controls and see if you can find the control you are after.

Commented Unassigned: Audio path permanently lost to instance of an application [16446]

$
0
0
I am building a Windows Forms application that uses NAUDIO to record / play audio tracks.

During testing on Windows 7 we disabled all input devices (mics) and tried to record some audio.

There was a path through the code that attempted to record via the default input in WaveIn mode.

"An unhandled exception of type 'NAudio.MmException' occured in NAudio.dll
Aditional information: BadDeviceId calling waveInOpen

NAudio.MmException was unhandled
HResult=-2146233088
Message=BadDeviceId calling waveInOpen
Source=NAudio
StackTrace:
at NAudio.MmException.Try(MmResult result, String function) in c:\Users\mike\Documents\CSharp\CommonProjects\NAudio\Wave\MmeInterop\MmException.cs:line 40
at NAudio.Wave.WaveIn.OpenWaveInDevice() in c:\Users\mike\Documents\CSharp\CommonProjects\NAudio\Wave\WaveInputs\WaveIn.cs:line 185
at NAudio.Wave.WaveIn.StartRecording() in c:\Users\mike\Documents\CSharp\CommonProjects\NAudio\Wave\WaveInputs\WaveIn.cs:line 198
at xxxxxxxxxxClient.Announcements.MicRecordingControl.OnBtnRecordClick(Object sender, EventArgs e) in c:\Users\mike\Documents\CSharp\Applications\xxxxxxxxxxClient\xxxxxxxxxxClient\Announcements\MicRecordingControl.cs:line 237
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at xxxxxxxxxxClient.CPU.Run() in c:\Users\mike\Documents\CSharp\Applications\xxxxxxxxxxClient\xxxxxxxxxxClient\CPU.cs:line 83
at xxxxxxxxxxClient.Program.Main(String[] args) in c:\Users\mike\Documents\CSharp\Applications\xxxxxxxxxxClient\xxxxxxxxxxClient\Program.cs:line 27
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:

Subsequently - if the application is restarted it will no longer play audio! Even if it is pre-recorded.

The Windows Audio Mixer shows audio at the input but nothing at the output, while other inputs (applications) continue to function normally.

Even a reboot of the computer will not clear the problem.

Installing a new copy of the application will resolve the problem i.e. the new install works but the previous install continues to fail.

I tried adding a mic back to the system and recording audio again from the failed application instance. This appears to have recovered the application.

My question - is this a known behaviour of Windows 7? Is there a workaround or other solution that avoids reinstall or having to install a mic and attempt to record again from the same application?

(Obviously I will eliminate the path through the code as well...)


Comments: I'm not sure how NAudio could break the system this drastically. All we're doing is calling waveInOpen. Sounds more like a bad soundcard driver

Created Unassigned: Bug in WaveFileReader if opening invalid RIFF file by filename [16448]

$
0
0
The WaveFileReader constructor that opens a file using a filename calls into the other constructor taking a stream. This other constructor calls a method to verify the RIFF header, but when this fails, an exception is thrown back to the caller.

This has the unfortunate effect that the first constructor, given the filename, doesn't get a chance to close the stream it opened. The stream is thus left open until GC or similar takes care of it.

The best way to handle this would be to do the following:

1. Refactor out the contents of the constructor taking a stream into a new, private, constructor, that also takes the `ownInput` value as a parameter.
2. Change the two existing constructors to chain to the new one, passing true/false for that new parameter as appropriate
3. The new constructor would have a try/catch block around it (or at least around the stream construction and RIFF header check), and if exception was thrown in the RIFF header validation, and ownInput is true, dispose of the stream before throwing the exception up the chain.

Commented Unassigned: Bug in WaveFileReader if opening invalid RIFF file by filename [16448]

$
0
0
The WaveFileReader constructor that opens a file using a filename calls into the other constructor taking a stream. This other constructor calls a method to verify the RIFF header, but when this fails, an exception is thrown back to the caller.

This has the unfortunate effect that the first constructor, given the filename, doesn't get a chance to close the stream it opened. The stream is thus left open until GC or similar takes care of it.

The best way to handle this would be to do the following:

1. Refactor out the contents of the constructor taking a stream into a new, private, constructor, that also takes the `ownInput` value as a parameter.
2. Change the two existing constructors to chain to the new one, passing true/false for that new parameter as appropriate
3. The new constructor would have a try/catch block around it (or at least around the stream construction and RIFF header check), and if exception was thrown in the RIFF header validation, and ownInput is true, dispose of the stream before throwing the exception up the chain.
Comments: This issue originates from a Stack Overflow question here: http://stackoverflow.com/questions/24824027/not-a-wave-file-no-riff-header-locks-file#24824075

Commented Unassigned: Bug in WaveFileReader if opening invalid RIFF file by filename [16448]

$
0
0
The WaveFileReader constructor that opens a file using a filename calls into the other constructor taking a stream. This other constructor calls a method to verify the RIFF header, but when this fails, an exception is thrown back to the caller.

This has the unfortunate effect that the first constructor, given the filename, doesn't get a chance to close the stream it opened. The stream is thus left open until GC or similar takes care of it.

The best way to handle this would be to do the following:

1. Refactor out the contents of the constructor taking a stream into a new, private, constructor, that also takes the `ownInput` value as a parameter.
2. Change the two existing constructors to chain to the new one, passing true/false for that new parameter as appropriate
3. The new constructor would have a try/catch block around it (or at least around the stream construction and RIFF header check), and if exception was thrown in the RIFF header validation, and ownInput is true, dispose of the stream before throwing the exception up the chain.
Comments: thanks for reporting, will try to get this fixed for a future NAudio

Created Unassigned: Playing Microsoft TTS with WASAPI [16449]

$
0
0
Hallo,

I have a problem playing Microsoft Text to Speech with WASAPI. I basically get an error (Not a WAVE file - no RIFF header) when the WaveFileReader tries to read the audioStream. As you can see in the code below I tried to convert the audioStream coming from Microsoft Text to Speech but it doesn't work.

```
using (SpeechSynthesizer synth = new SpeechSynthesizer())
using (MemoryStream streamAudio = new MemoryStream())
{
// Create a SoundPlayer instance to play the output audio file.
System.Media.SoundPlayer m_SoundPlayer = new System.Media.SoundPlayer();

SpeechAudioFormatInfo speechFormat = new SpeechAudioFormatInfo(EncodingFormat.Pcm, 32000, 8, 2, 8000, 2, null);

//synth.SelectVoice(AppSettings.VoiceName);

// Configure the synthesizer to output to an audio stream.
synth.SetOutputToAudioStream(streamAudio,speechFormat);

// Speak a phrase.
synth.Speak("Hallo Jonas wie gehts es dir?");
streamAudio.Position = 0;
synth.SetOutputToNull();

_wasapiOut = new WasapiOut(device, AudioClientShareMode.Shared, false, 2000);

RawSourceWaveStream s = new RawSourceWaveStream(streamAudio, new WaveFormat(32000, 8, 2));
WaveStream ws = WaveFormatConversionStream.CreatePcmStream(s);

_reader = new WaveFileReader(streamAudio);
_wasapiOut.Init(_reader);
_wasapiOut.Play();
}
```

I hope somebody can help me :)

Edited Unassigned: Playing Microsoft TTS with WASAPI [16449]

$
0
0
Hallo,

I have a problem playing Microsoft Text to Speech with WASAPI. I basically get an error (Not a WAVE file - no RIFF header) when the WaveFileReader tries to read the audioStream. As you can see in the code below I tried to convert the audioStream coming from Microsoft Text to Speech by using the RawSourceWaveStream and the WaveFormatConversionStream. Unfortunately that doesn't work.

```
using (SpeechSynthesizer synth = new SpeechSynthesizer())
using (MemoryStream streamAudio = new MemoryStream())
{
// Create a SoundPlayer instance to play the output audio file.
System.Media.SoundPlayer m_SoundPlayer = new System.Media.SoundPlayer();

SpeechAudioFormatInfo speechFormat = new SpeechAudioFormatInfo(EncodingFormat.Pcm, 32000, 8, 2, 8000, 2, null);

//synth.SelectVoice(AppSettings.VoiceName);

// Configure the synthesizer to output to an audio stream.
synth.SetOutputToAudioStream(streamAudio,speechFormat);

// Speak a phrase.
synth.Speak("Hallo Jonas wie gehts es dir?");
streamAudio.Position = 0;
synth.SetOutputToNull();

_wasapiOut = new WasapiOut(device, AudioClientShareMode.Shared, false, 2000);

RawSourceWaveStream s = new RawSourceWaveStream(streamAudio, new WaveFormat(32000, 8, 2));
WaveStream ws = WaveFormatConversionStream.CreatePcmStream(s);

_reader = new WaveFileReader(streamAudio);
_wasapiOut.Init(_reader);
_wasapiOut.Play();
}
```

I hope somebody can help me :)

Edited Unassigned: Playing Microsoft TTS with WASAPI [16449]

$
0
0
Hallo,

I have a problem playing Microsoft Text to Speech with WASAPI. I basically get an error (Not a WAVE file - no RIFF header) when the WaveFileReader tries to read the audioStream. As you can see in the code below I tried to convert the audioStream coming from Microsoft Text to Speech by using the RawSourceWaveStream and the WaveFormatConversionStream. Unfortunately that doesn't work. I need to play the audio with WASAPI because I want to select a specific device to play the audio with.

```
using (SpeechSynthesizer synth = new SpeechSynthesizer())
using (MemoryStream streamAudio = new MemoryStream())
{
// Create a SoundPlayer instance to play the output audio file.
System.Media.SoundPlayer m_SoundPlayer = new System.Media.SoundPlayer();

SpeechAudioFormatInfo speechFormat = new SpeechAudioFormatInfo(EncodingFormat.Pcm, 32000, 8, 2, 8000, 2, null);

//synth.SelectVoice(AppSettings.VoiceName);

// Configure the synthesizer to output to an audio stream.
synth.SetOutputToAudioStream(streamAudio,speechFormat);

// Speak a phrase.
synth.Speak("Hallo Jonas wie gehts es dir?");
streamAudio.Position = 0;
synth.SetOutputToNull();

_wasapiOut = new WasapiOut(device, AudioClientShareMode.Shared, false, 2000);

RawSourceWaveStream s = new RawSourceWaveStream(streamAudio, new WaveFormat(32000, 8, 2));
WaveStream ws = WaveFormatConversionStream.CreatePcmStream(s);

_reader = new WaveFileReader(streamAudio);
_wasapiOut.Init(_reader);
_wasapiOut.Play();
}
```

I hope somebody can help me :)

Commented Unassigned: Playing Microsoft TTS with WASAPI [16449]

$
0
0
Hallo,

I have a problem playing Microsoft Text to Speech with WASAPI. I basically get an error (Not a WAVE file - no RIFF header) when the WaveFileReader tries to read the audioStream. As you can see in the code below I tried to convert the audioStream coming from Microsoft Text to Speech by using the RawSourceWaveStream and the WaveFormatConversionStream. Unfortunately that doesn't work. I need to play the audio with WASAPI because I want to select a specific device to play the audio with.

```
using (SpeechSynthesizer synth = new SpeechSynthesizer())
using (MemoryStream streamAudio = new MemoryStream())
{
// Create a SoundPlayer instance to play the output audio file.
System.Media.SoundPlayer m_SoundPlayer = new System.Media.SoundPlayer();

SpeechAudioFormatInfo speechFormat = new SpeechAudioFormatInfo(EncodingFormat.Pcm, 32000, 8, 2, 8000, 2, null);

//synth.SelectVoice(AppSettings.VoiceName);

// Configure the synthesizer to output to an audio stream.
synth.SetOutputToAudioStream(streamAudio,speechFormat);

// Speak a phrase.
synth.Speak("Hallo Jonas wie gehts es dir?");
streamAudio.Position = 0;
synth.SetOutputToNull();

_wasapiOut = new WasapiOut(device, AudioClientShareMode.Shared, false, 2000);

RawSourceWaveStream s = new RawSourceWaveStream(streamAudio, new WaveFormat(32000, 8, 2));
WaveStream ws = WaveFormatConversionStream.CreatePcmStream(s);

_reader = new WaveFileReader(streamAudio);
_wasapiOut.Init(_reader);
_wasapiOut.Play();
}
```

I hope somebody can help me :)
Comments: I solved it. I had to set the Encoding of the SpeechAudioFormatInfo to ALaw and the RawSourceWaveStream has to instantiate also a Alaw Format. The WaveFileReader is then pointless and wasapi can simply Init it. ``` ALawFormat = new SpeechAudioFormatInfo(EncodingFormat.ALaw, 44100, 8, 1, 1, 2, null); ... RawSourceWaveStream s = new RawSourceWaveStream(memoryStream, WaveFormat.CreateALawFormat(44100, 1)); ws = WaveFormatConversionStream.CreatePcmStream(reader); _wasapiOut.Init(ws); _wasapiOut.Play(); ```

Commented Unassigned: Playing Microsoft TTS with WASAPI [16449]

$
0
0
Hallo,

I have a problem playing Microsoft Text to Speech with WASAPI. I basically get an error (Not a WAVE file - no RIFF header) when the WaveFileReader tries to read the audioStream. As you can see in the code below I tried to convert the audioStream coming from Microsoft Text to Speech by using the RawSourceWaveStream and the WaveFormatConversionStream. Unfortunately that doesn't work. I need to play the audio with WASAPI because I want to select a specific device to play the audio with.

```
using (SpeechSynthesizer synth = new SpeechSynthesizer())
using (MemoryStream streamAudio = new MemoryStream())
{
// Create a SoundPlayer instance to play the output audio file.
System.Media.SoundPlayer m_SoundPlayer = new System.Media.SoundPlayer();

SpeechAudioFormatInfo speechFormat = new SpeechAudioFormatInfo(EncodingFormat.Pcm, 32000, 8, 2, 8000, 2, null);

//synth.SelectVoice(AppSettings.VoiceName);

// Configure the synthesizer to output to an audio stream.
synth.SetOutputToAudioStream(streamAudio,speechFormat);

// Speak a phrase.
synth.Speak("Hallo Jonas wie gehts es dir?");
streamAudio.Position = 0;
synth.SetOutputToNull();

_wasapiOut = new WasapiOut(device, AudioClientShareMode.Shared, false, 2000);

RawSourceWaveStream s = new RawSourceWaveStream(streamAudio, new WaveFormat(32000, 8, 2));
WaveStream ws = WaveFormatConversionStream.CreatePcmStream(s);

_reader = new WaveFileReader(streamAudio);
_wasapiOut.Init(_reader);
_wasapiOut.Play();
}
```

I hope somebody can help me :)
Comments: great. glad you got it working

Created Unassigned: multiple wave normalization [16450]

$
0
0
hi,

just want to ask is there any examples on peak normalization and average normalization for multiple waves

thanks

Commented Unassigned: multiple wave normalization [16450]

$
0
0
hi,

just want to ask is there any examples on peak normalization and average normalization for multiple waves

thanks
Comments: not at the moment I'm afraid. Also, make sure it really is normalization you want. Usually a limiter or compressor is a more appropriate choice
Viewing all 738 articles
Browse latest View live


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