Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Question regarding streaming wav file

Hi,

I want to stream wav file from server to client. I am able to read the wav file header and the data. I have the following questions:-

1. How do I break the wav file into small chunks for real time streaming?
2. How do I manage the buffer at client and server side?

Thanks.

Comments

  • SephirothSephiroth Fayetteville, NC, USAPosts: 1,035Member
    I suggest you head over to GameDev and check out Beej's Socket Tutorial. You see, you have to know TCP/IP and/or UDP/IP to do what you'd like to do. Sockets are simple enough to do, until you start dealing with firewalls and such. Anyway, once you get a socket open and connected, you simply write to it as though it is a file! You can easily set the buffer size and such, read that buffer from your WAV source, then write it to the socket. Network coding is a LOT simpler than you think!

    -[italic][b][red]S[/red][purple]e[/purple][blue]p[/blue][green]h[/green][red]i[/red][purple]r[/purple][blue]o[/blue][green]t[/green][red]h[/red][/b][/italic]

  • kanchanckanchanc Posts: 3Member
    I have a connection between client and server working. I want to use RTP for real-time audio streaming from client to server. On server side, I am able to read the wav file. Now the question is how to send the wav file in chunks to the client?

    My understanding for that is the client should have a buffer and the server sends data in small parts to client. The client plays the buffered data, & by that time the server sends further data. I am confused how to break the wav file.

    Thanks.

    : I suggest you head over to GameDev and check out Beej's Socket Tutorial. You see, you have to know TCP/IP and/or UDP/IP to do what you'd like to do. Sockets are simple enough to do, until you start dealing with firewalls and such. Anyway, once you get a socket open and connected, you simply write to it as though it is a file! You can easily set the buffer size and such, read that buffer from your WAV source, then write it to the socket. Network coding is a LOT simpler than you think!
    :
    : -[italic][b][red]S[/red][purple]e[/purple][blue]p[/blue][green]h[/green][red]i[/red][purple]r[/purple][blue]o[/blue][green]t[/green][red]h[/red][/b][/italic]
    :
    :

  • SephirothSephiroth Fayetteville, NC, USAPosts: 1,035Member
    The same way you would write part of a buffer to a stream. You don't physically 'break' the actual file, you only read part of it at a time.

    -[italic][b][red]S[/red][purple]e[/purple][blue]p[/blue][green]h[/green][red]i[/red][purple]r[/purple][blue]o[/blue][green]t[/green][red]h[/red][/b][/italic]

Sign In or Register to comment.