Quantcast
Channel: NAudio
Viewing all articles
Browse latest Browse all 5831

New Post: "vshost32.exe has stopped working" MOTU+Naudio

$
0
0

Hi all!

Im pretty fresh at this, but I cant get DSebJs tutorial to work (http://opensebj.blogspot.com/2009/02/introduction-to-using-naudio.html) in other then ASIO4ALL and with 16-bit wave-files.

If I use ASIO4ALL and 16-bit files, the program code below works. But the target audiointerface (MOTU UltraLite) crashes and the reason stated is:

"vshost32.exe has stopped working"

Problem signature:

Problem Event Name: BEX
Application Name: AudioViaASIO.vshost.exe
Application Version: 11.0.40825.2
Application Timestamp: 4e55ba46
Fault Module Name: StackHash_3ce7
Fault Module Version: 0.0.0.0
Fault Module Timestamp: 00000000
Exception Offset: 05aaec0c
Exception Code: c0000005
Exception Data: 00000008
OS Version: 6.1.7601.2.1.0.256.48
Locale ID: 1053
Additional Information 1: 3ce7
Additional Information 2: 3ce712e06389c7274746ad5f0c1dc1c9
Additional Information 3: 1835
Additional Information 4: 1835a9d5b62f304ea03f41ed661569d9

Am I missing something basic here? Please help me!!

 Regards / soundBerg


 

The tutorialbased code I have tried:

using System;
using System.Windows.Forms;
using NAudio.Wave;
using NAudio.CoreAudioApi;

namespace WindowsFormsApplication1

{

public partial class Form1 : Form
{

public Form1()
    {
InitializeComponent();
IWavePlayer waveOutDevice;
WaveStream mainOutputStream = null;
string fileName = "C:\\sinus16bit.wav";

try
                {
          waveOutDevice = new AsioOut();*

 }
catch (Exception driverCreateException)
{
MessageBox.Show(String.Format("{0}", driverCreateException.Message));
return;
        }

        if (fileName != null)
{
                try
{
mainOutputStream = CreateInputStream(fileName);
}
catch (Exception initException)
{
MessageBox.Show(String.Format("{0}", initException.Message), "Error Initializing Output");
       return;
}
waveOutDevice.Init(mainOutputStream);
waveOutDevice.Play();
}
}

private WaveStream CreateInputStream(string fileName)
{
WaveChannel32 inputStream;
if (fileName.EndsWith(".wav"))
                {
WaveStream readerStream = new WaveFileReader(fileName);
if (readerStream.WaveFormat.Encoding != WaveFormatEncoding.Pcm)
{
readerStream = WaveFormatConversionStream.CreatePcmStream(readerStream);
readerStream = new BlockAlignReductionStream(readerStream);
}
if (readerStream.WaveFormat.BitsPerSample != 16)
{
var format = new WaveFormat(readerStream.WaveFormat.SampleRate,16, readerStream.WaveFormat.Channels);
readerStream = new WaveFormatConversionStream(format, readerStream);
}
inputStream = new WaveChannel32(readerStream);
}
else
                {
                        throw new InvalidOperationException("Unsupported extension");
}
                return inputStream;
}

}

}


Viewing all articles
Browse latest Browse all 5831

Trending Articles



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