Jump to content
Fiskey111

Playing Audio

Recommended Posts

Hi Guys,

So I'd like to be able to play an audio recording of a person's voice.  I tried using the Functions.PlayScannerAudio() but I found out that there is a limit to the length of the audio apparently.  Any idea how to play the audio?  I really don't want to try to break up this audio to make it work, but I will if there is no other way!

Thanks!

 

Share this post


Link to post
Share on other sites

The simplest way is using System.Media.SoundPlayer:

        public static void PlaySound(string wavFileLocation)
        {
            using (SoundPlayer s = new SoundPlayer(wavFileLocation))
                s.Play();
        }

 

For what I needed, it was enough.

Share this post


Link to post
Share on other sites
12 minutes ago, alexguirre said:

The simplest way is using System.Media.SoundPlayer:

        public static void PlaySound(string wavFileLocation)
        {
            using (SoundPlayer s = new SoundPlayer(wavFileLocation))
                s.Play();
        }

 

For what I needed, it was enough.

I agree, this is probably the best way if you're looking to play something simple :smile:

Share this post


Link to post
Share on other sites
33 minutes ago, alexguirre said:

The simplest way is using System.Media.SoundPlayer:

        public static void PlaySound(string wavFileLocation)
        {
            using (SoundPlayer s = new SoundPlayer(wavFileLocation))
                s.Play();
        }

 

For what I needed, it was enough.

I feel like I should have known about that...lol.

But I've never had to work with playing audio files in my career before :tongue:

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×