How do I use OGG with SDL_Mixer? - xcode

I can't seem to get SDL_Mixer to initialize with OGG support enabled. I know that I must link with libogg, libvorbis and libvorbisfile but it still won't work. I have .dylibs, .frameworks and .as of these three libraries and I've tried them all.
I'm copying the dylibs/frameworks into the Frameworks folder of the app package in the build phases tab.
I have Runpath Search Paths set to #executable_path/../Frameworks in the build settings tab.
But Mix_Init(MIX_INIT_OGG) keeps returning the error OGG support not available.
I'm using the latest Homebrew versions of all of the mentioned libraries. I'm not sure what else to try.
I have a finished game with 300MB of wavs as the music.
Update
I’ve managed to mix some Objective C with C++ and get some sound playing with AVAudioPlayer but it’s horrendous code. I’m having to cast to void * to make sure my music player class is compatible with my C++ code base. The garbage collector is so annoying. All it does is get in your way. You have to fight it with bridge casts.
I’d really like to use SDL_Mixer or a simple C library.

I got the Objective C music player fully implemented but I just can’t stand Objective C. I found a brilliant library called stb_vorbis. I’ve used a few of the other stb libraries so I knew this one would be great. Playing the audio data from this library is actually pretty easy. All I really had to do was call stb_vorbis_get_samples_short_interleaved inside of SDL2’s audio callback. I didn’t have to do any mixing because I only need to play music. The implementation was so simple that it actually worked perfectly the first time I ran it! This because stb_vorbis and SDL2 are both C libraries so they just make sense (unlike Objective C which should be burned).
TL;DR
If you just want to play music and either can’t use SDL_Mixer or don’t want to use SDL_Mixer then you can just feed the data from stb_vorbis into SDL2’s audio callback.

Related

How do I play an MP3 file using Lazarus on macOS

I'd like to be able to play an MP3 file programmatically, using Lazarus on macOS.
Lazarus 2.0 (fpc 3.0.4) on macOS is working great for me, but one thing I cannot manage to do is to play an MP3 file programmatically.
I managed to compile and run the OALSoundManager demo project, but only WAV files can be played that way.
I spent several hours following various leads from the freepascal forum, but I still could not manage to do the basic play operations:
Load an MP3 file
Start playing it.
Get the current playing position (e.g. during OnTimer).
Be notified when it stops.
I'm OK with using any common library. Of course the less dependencies the better.
Once I can play the file I can figure out the rest, but it would be great if the example also showed:
Start playing from a given time position
Pause/Restart
Thank you very much for any help!
You might be able to use Castle Engine and OpenAL.
You can install Castle Engine from with-in Lazarus. In the main menu under "Package" -> "Online Package Manager" you will be able to filter and install "castle".
Then you should be able to open the example project:
https://github.com/castle-engine/castle-engine/blob/master/examples/audio/alplay.lpr
Goodluck,

Xamarin.Forms video streaming library that supports RTSP video feeds

I am using Plugin.MediaManager NuGet package to provide cross-platform video player for my app. However, it does not support playing RTSP video streams. Is there any other library that supports this?
I have looked around and the most common ones are platform-specific libraries such as KXmovie and Managed Media Aggregation but I am a little intimidated by the thought of having to port and/or recompile them.
The best case is if there is a Xamarin.Forms compatible NuGet package available. Failing that, an iOS library that requires binding, but not recompiling. As a last resort, something that needs to be compiled and linking manually, but works out of the box.
OK so the resounding conclusion is that one does not exist with Xamarin bindings. I will start with this project on GitHub and see if I can compile and generate the bindings myself.
A bit late, but there is now. LibVLCSharp supports RTSP (and many other stuff).

How to build pjsip on windows

I am going to build pjsip on window7,and I almost be ready to compile the project,but something confused me is one of the steps show in this page:link
It is said about SDL2,describe is here:
SDL sources comes with VS project settings, under VisualC sub-directory
So,what should I do indict by the description?
Another question,should I build SDL2 from source?
You should build SDL only if you want to compile PJSIP with video enabled.
It is used for rendering only. If you want you can build it from source.
Another option for rendering is DirectShow but it's broken for ages.
I developed a renderer driver for PJSIP to render to a bitmap and than I render this bitmap in C#. It's easier and works fast.
Also for video you will need ffmpeg at least for codecs.
My opinion: start without video. It's not easy to make it work and might be you won't need it at all.

Playing video in Qt (on a Mac)

This question arises out of a combination of this being my first time working with video and unfamiliarity with Macs. Basically I'm finding it difficult to figure out how to play a video (within a QWidget, or otherwise) using any standard format, e.g. avi, mpeg, mov, etc. In particular,
QMovie::supportedFormats() gives me only .gif and .mng, but I need to use standard formats. Is there a way to increase the number of supported formats?
Phonon requires the presence of a 'backend' which the user has to implement himself. I looked to see if I could somehow do this with Quicktime, but I couldn't get the application to launch--and anyway I didn't really see how to do that. Also, Phonon looks pretty heavyweight, I'd like to avoid it if I could.
While there are plenty of avi (et al.) players floating around on the web, I think it's probably unlikely I'd be able to use them--I need to start, stop, and change the playback speed of videos programmatically i.e. through my C++ program.
I'm not sure why this should be so hard--working with images in Qt is a snap by comparison. So: What's a good way to play videos from within a C++/Qt program?
Stop what you are doing right now: Phonon is the past, Qt Mobility is the future.
After you download, compile and install Qt Mobility, check the examples: videowidget and videographicsitem, located at: qt-mobility-opensource-src-1.2.0/examples/
They pretty much answer all your questions.

Play a video using gtk+

Any suggestion regarding how to play videos using GTK+?
Regards,
Lancy Norbert Fernandes
For Playing Videos on GTK+ and other GTK Bindings you have a lot of options.
Option: Use A Third-Party Library
1- Try using ogmrip-gtk , A set of Gtk Interface, which allows you to use the open-source OGMRip library as a Gtk-Widget.
2- You may use another library, gstreamer. Also can be used easily with Gtk.
3- You may use LibVLC - gtk. A GTK wrapper for LibVLC (ever used the VLC Media Player?). Personally , I like this a lot.
Option: Using Code from Open-Source Software
1- The Banshee media player is open-source and although it uses Gtk#, you may have no trouble converting the code to GTK+.
2- See the MPlayer or Totem Player Source Code. (or any other for that matter, here is a list )
Option: Use A Process
1- I've heard the MPlayer Command Line is pretty simple. Here's a guide. http://www.mplayerhq.hu/DOCS/HTML/en/commandline.html
With GTK+ there are always a lot of new and innovative (not to mention open-source) ways to do stuff. So always keep looking for better ways. I am personally a great fan of the GTK+ toolkit and have found that there is nothing you cannot do with it.
GStreamer integrates well with GTK+.

Resources