pygame-web / pygbag

python and pygame wasm for everyone ( packager + test server + simulator )
https://github.com/pygame-web
MIT License
295 stars 34 forks source link

should pygame.mixer.Channel.set_source_location() work with negative angle values ? #139

Open Robomarchello opened 7 months ago

Robomarchello commented 7 months ago

A really specific issue, but when calling pygame.mixer.Channel.set_source_location() with negative angle value, pygbag seems to ignore negative sign, so it plays in the right instead of the left

import pygame

pygame.init()
pygame.mixer.init()

sound = pygame.mixer.Sound("zombie.ogg")

angle = -90
channel = sound.play()
channel.set_source_location(angle, 100)
pmp-p commented 7 months ago

any chance you have a sdl2 C sample for that ? it could be a sdl2 port problem

pmp-p commented 7 months ago

SDL_mixer documentation suggests that angle value should be 0-360 range so -90 would be 360-90 instead. Maybe pygame-ce should ensure the conversion here ?

The fact it worked on desktop could be pure coincidence