2

I'd like to write software that generates audio in real-time and streams it over the network/internet as an MPEG2 Transport Stream. Ideally the solution would be in Python (though Java would be ok too).

Basically I'd like to end up with code that does the equivalent of the following pseudocode:

streamer = create_streamer(url, port)
while True:
    audio_buffer = generate_audio_buffer()  # synthesize some raw audio data
    encoded_buffer = encode(audio_buffer)   # encode appropriately
    streamer.stream(encode_buffer)

My question is, what are the best strategies for doing this? Should I use gstreamer, and if so, would I have to write my own source plugin (and can that be done in Python)? Or are there PyAudio-based solutions? Are there other options?

Any pointers would be much appreciated.

aengus
  • 21
  • 1

0 Answers0