https://github.com/icculus/smpeg
Loki Software's MPEG decoding library.
https://github.com/icculus/smpeg
sdl smpeg
Last synced: 12 months ago
JSON representation
Loki Software's MPEG decoding library.
- Host: GitHub
- URL: https://github.com/icculus/smpeg
- Owner: icculus
- License: lgpl-2.1
- Created: 2021-07-11T04:10:52.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2024-05-23T15:47:09.000Z (about 2 years ago)
- Last Synced: 2025-04-20T19:38:53.638Z (about 1 year ago)
- Topics: sdl, smpeg
- Language: C++
- Homepage: https://icculus.org/smpeg/
- Size: 1.83 MB
- Stars: 17
- Watchers: 6
- Forks: 6
- Open Issues: 5
-
Metadata Files:
- Readme: README.SDL_mixer
- Changelog: CHANGES
- Funding: .github/FUNDING.yml
- License: LICENSE.txt
Awesome Lists containing this project
README
There is no longer explicit support for the SDL_mixer library.
You can have the SDL mixer library mix audio from a movie by hooking into
the SDL mixer music hooks:
#include "smpeg.h"
#include "SDL_mixer.h"
.. set up the mixer audio ...
/* Note the last parameter is zero! */
mpeg = SMPEG_new("file.mpg", &info, 0);
/* Play the movie, using SDL_mixer for audio */
SMPEG_enableaudio(mpeg, 0);
if ( play_audio ) {
SDL_AudioSpec audiofmt;
Uint16 format;
int freq, channels;
/* Tell SMPEG what the audio format is */
Mix_QuerySpec(&freq, &format, &channels);
audiofmt.format = format;
audiofmt.freq = freq;
audiofmt.channels = channels;
SMPEG_actualSpec(mpeg, &audiofmt);
/* Hook in the MPEG music mixer */
Mix_HookMusic(SMPEG_playAudioSDL, mpeg);
SMPEG_enableaudio(mpeg, 1);
}
SMPEG_play(mpeg);
/* Stop the movie and unhook SMPEG from the mixer */
SMPEG_stop(mpeg);
Mix_HookMusic(NULL, NULL);