Creating Sound object from raw audio

Issue #193 resolved
fenuks created an issue

Is there any chance of adding support for raw audio playing? E.g. it could look like this

audio_format = {'frequency':22050, 'size':8, 'channels':1}
sound = pygame.mixer.Sound(buffer=raw_audio_data, raw=True, format=audio_format)

By default raw would be set to False so it would not change default behaviour (raw flag might be not necessary if pygame will check if format isn't empty dict, if don't then data is raw). Of course conversion from raw to wav or ogg can be done by game logic, but I think it's bit inefficient and having this option directly in pygame would be optimal solution. Thanks.

Comments (6)

  1. Log in to comment