1. pygame
  2. pygame
  3. pygame
  4. Issues


Issue #193 new

Creating Sound object from raw audio

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.