http://qs321.pair.com?node_id=587500


in reply to SDL::Mixer - How to specify the device?

Just helping you troubleshoot, but your script dosn't play on my linux box with the latest kernel and alsa. So I'm not sure, but there are 2 possible errors I see.

1. Try this script, it uses play_music instead of play_channel, and puts a loop at the end to keep the script from exiting prematurely.

#!/usr/bin/perl use strict; use warnings; use SDL; use SDL::Mixer; use SDL::Music; my $mixer = SDL::Mixer->new( -frequency => MIX_DEFAULT_FREQUENCY, # 22050 -format => MIX_DEFAULT_FORMAT, # AUDIO_S16 -channels => MIX_DEFAULT_CHANNELS, # 8 -size => 1024 #higher numbers give sloppy reponse #as buffers continue to empty ); # provides 8 channels of # 16 bit audio at 22050 Hz. and a single channel of music. #background can be mp3,ogg or wav (mp3 needs smpeg libs) my $mp3 = new SDL::Music('1bb.mp3'); $mixer->music_volume(MIX_MAX_VOLUME); #128 $mixer->play_music( $mp3, 100 ); my $done = 0; while (! $done && ( SDL::GetAudioStatus() == SDL_AUDIO_PLAYING())) {SDL::Delay(1); }

2. Look for /dev/sequencer in /dev. On my alsa setup there is a link to /dev/sound/sequencer, which is what alsa sets up. Maybe you are missing the link?

See Tk Game Sound demo


I'm not really a human, but I play one on earth. Cogito ergo sum a bum