How to stream a WAV file?

后端 未结 3 1656
天命终不由人
天命终不由人 2020-12-21 10:06

I\'m writing an app where I record audio and upload the audio file over the web. In order to speed up the upload I want to start uploading before I\'ve finished recording.

3条回答
  •  生来不讨喜
    2020-12-21 10:33

    You will just have to use a container format that supports appending without editing the header.

    I suggest Raw PCM samples. They can be converted to anything else at will.

    Audacity will import raw bytes from the File -> Import -> Raw Data menu.

    Another option might be a lossless audio codec such as FLAC inside of a streamable container format. (As done by a Czech web radio station)

    I notice VLC can compress and stream FLAC-in-OGG from the soundcard. Should be a simple step from there to store or uncompress the stream on the server end.

提交回复
热议问题