Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^2: SDL::Mixer for Ubuntu 19.04

by Dirk80 (Pilgrim)
on Nov 03, 2019 at 18:14 UTC ( [id://11108278]=note: print w/replies, xml ) Need Help??


in reply to Re: SDL::Mixer for Ubuntu 19.04
in thread SDL::Mixer for Ubuntu 19.04

Thanks!! You are right. The API changed completely. I now changed the code as follows, and it works.:

use SDL; use SDL::Mixer; use SDL::Mixer::Music; printf("Error initializing SDL_mixer: %s\n", SDL::get_error()) unless +SDL::Mixer::open_audio(22050, AUDIO_S16, 2, 1024) == 0; playMusicFile("test.wav"); sub playMusicFile { my $music_file = $_[0]; my $music = SDL::Mixer::Music::load_MUS( $music_file ); SDL::Mixer::Music::volume_music( 40 ); my $play_music = SDL::Mixer::Music::play_music( $music, 1 ); print $play_music; SDL::delay(10000); # fix delay, better would be a solution to wait + until song is finished, I have to find out this later }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11108278]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (10)
As of 2024-04-18 08:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found