Dirk80 has asked for the wisdom of the Perl Monks concerning the following question:
I have an old script which is using the SDL::Mixer. But it is not running anymore. Installing SDL::Mixer via cpan failed for me. So I installed it via sudo apt-get install libsdl-perl.
I tried to run the following code:
#!/usr/bin/perl use strict; use warnings; use SDL::Mixer; my $mixer = SDL::Mixer->new( -frequency => 22050, -channels => 2, -size => 1024);
But I get the following error message:
Can't locate object method "new" via package "SDL::Mixer" at test.pl l +ine 8.
I have no idea what to do. Is SDL::Mixer not correctly installed? What do you recommend? Thank you very much!
Some more information: The following code tells me that I have version 1.2.12 installed.
The code in my script which I wrote in 2013 to play a wav-file looks as follows:use SDL::Mixer; use SDL::Version; my $version = SDL::Mixer::linked_version(); printf("%d.%d.%d\n", $version->major, $version->minor, $version->patch +);
use SDL::Mixer; use SDL::Music; playMusicFile("test.wav"); BEGIN { my $music; my $mixer = SDL::Mixer->new( -frequency => 22050, -channels => 2, -size => 1024); sub playMusicFile { my $music_file = $_[0]; $music = new SDL::Music $music_file; $mixer->music_volume(40); $mixer->play_music($music, 0); } }
But as told before it is not working anymore.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: SDL::Mixer for Ubuntu 19.04
by hippo (Archbishop) on Nov 03, 2019 at 16:23 UTC | |
by Dirk80 (Pilgrim) on Nov 03, 2019 at 18:14 UTC | |
|
Re: SDL::Mixer for Ubuntu 19.04
by 1nickt (Canon) on Nov 03, 2019 at 15:51 UTC |