Jump to content

Playing and writing to an audio buffer


Recommended Posts

Hi there,

In my previous thread I got figured out how to trim a recorded sound file.

Now, here's my next challenge: Playing an audio "buffer" while writing new audio data to this buffer every few seconds.

Here's the situation:

PC A records long.wav

PC A splits long.wav into part1.wav and part2.wav

PC A uploads part1.wav

PC B downloads part1.wav and plays it

PC B starts downloading part2.wav while part1.wav is playing

PC B writes the sound data to part1.wav, so it will keep on playing

Any idea on how to do this? Maybe there's some kind of commandline tool that could help? Maybe using DLLCalls with DirectSound? Any ideas?

Note that I already tried playing part2.wav instantly after part1.wav to get the same result, but this does not work because there is a small sound disruption for a few milliseconds if you try to do this (also discussed that in my previous thread: http://www.autoitscript.com/forum/index.php?showtopic=73068).

Thanks for all the help you can give.

- Tom

Link to comment
Share on other sites

It seems like you wouldnt be able to write to a .wav file that is already open since it would throw some kind of file access error.

Have you looked at just streaming the audio or having computer B access the file on computer A through the network (instead of loading it locally)?

Link to comment
Share on other sites

It seems like you wouldnt be able to write to a .wav file that is already open since it would throw some kind of file access error.

Have you looked at just streaming the audio or having computer B access the file on computer A through the network (instead of loading it locally)?

Hi Distrophy,

Sure I could stream using a TCP connection but that is not really what I want for special reasons.

You can not write to a .wav file that is already being opened yeah, but I believe that is what a memory buffer does. It's not really a .wav file but a buffer containing data that can be written to.

However, if that doesn't work: my problem can probably also be solved with a commandline tool that can play sound files with gapless transition (from songA to songB) in which you can add new songs to the playlist or repeat the playlist. Without an interface is a must though.

Hopefully anyone is aware of such a tool or maybe still the original idea regarding DLLcalls or something.

Link to comment
Share on other sites

  • Moderators

Hi Distrophy,

Sure I could stream using a TCP connection but that is not really what I want for special reasons.

You can not write to a .wav file that is already being opened yeah, but I believe that is what a memory buffer does. It's not really a .wav file but a buffer containing data that can be written to.

However, if that doesn't work: my problem can probably also be solved with a commandline tool that can play sound files with gapless transition (from songA to songB) in which you can add new songs to the playlist or repeat the playlist. Without an interface is a must though.

Hopefully anyone is aware of such a tool or maybe still the original idea regarding DLLcalls or something.

After asking your legality question, I doubt those that do know are going to readily volunteer the answers anyway.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

After asking your legality question, I doubt those that do know are going to readily volunteer the answers anyway.

Oh the moderator is acting very helpfull again.

NOT!

Also, this has nothing to do with that particular subject.

Link to comment
Share on other sites

  • Moderators

Oh the moderator is acting very helpfull again.

NOT!

Also, this has nothing to do with that particular subject.

Don't be a moron. I was telling you why you may not be getting the answers you are wanting.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...