0

I'm attempting to teach myself audio programming in C# through online tutorials. I'm using wave files (*.wav) with SoundPlayer.

What confuses me is this: why do the tutorials bother reading in and chopping up a wave file if we're just going to blindly feed it into SoundPlayer anyway ?

I feel like I'm missing a gigantic conspiracy. Is the trouble just that SoundPlayer is too simple, and I need to take more advanced control ??

Thank you in advance!

FYI - The tutorials I'm using are:

1 Answers1

0

I'm not familiar with SoundPlayer or c#, but usually you read audio files in parts to avoid exhausting memory. It also allows you to start playback faster, since the first part of the file will be available in much less time than the entire file.

Bjorn Roche
  • 11,279
  • 6
  • 36
  • 58
  • That's logical. What I'm failing to understand is this: it seems to me that I could just blit the wave file from disk into memory (without chopping it up), and then feed this into SoundPlayer. If it's that easy, I imagine that chopping it up must instead provide some additional benefit, but I don't see what that benefit is. -_- – rpgZenMaster Aug 21 '13 at 05:02
  • "blitting" the file into memory from disk, as you suggest, still requires reading the entire file from disk. Audio files can be very very large. If you know in advance that you are only going to be dealing with files of, say, a few kB, that's obviously fine, but I routinely deal with audio files in the 100s of megabytes where this is untenable. – Bjorn Roche Aug 21 '13 at 13:42