Request mp3 player MFD for XRSound

dgatsoulis

ele2png user
Joined
Dec 2, 2009
Messages
1,846
Reaction score
142
Points
78
Location
Sparta
Well the title says it all.

XRSound is great but I miss the ability to play whatever track I want from my music folder in Orbiter.

Can anyone make an MFD that allows you to do that?

-List the music tracks in th XRSound\Default\Music folder. (or any custom folder specified in a cfg file).

-Select a track from the list (UP, DWN, for up, down)

-Play the selected track. (PL button)

-Stop playing (STP)

-Additional mute and volume+/- buttons would be great but not completely necessary.
 

dbeachy1

O-F Administrator
Administrator
Orbiter Contributor
Addon Developer
Donator
Beta Tester
Joined
Jan 14, 2008
Messages
9,151
Reaction score
1,480
Points
203
Location
VA
Website
alteaaerospace.com
Preferred Pronouns
He/Him
As a side note, playing sounds directly from an MFD via XRSound will require using XRSound 2.0 Beta-3 or newer. Version 2.0 is pretty much ready for release, but I've been holding off in case some bugs pop up in 1.0 that I want to fix in the next release.
 

Pioneer

Well-known member
Joined
Mar 2, 2012
Messages
450
Reaction score
215
Points
58
Actually not just MP3 format, but FLAC, Windows stuff and a bunch of other formats should be included as well. My music library is primarily FLAC.
 

Papabear73

New member
Joined
Feb 12, 2018
Messages
1
Reaction score
0
Points
0
@dbeachy1, can you produce an "How-to" about playing mp3 from MFD with XRsound2 Beta please? I haven't found anything in documentation
 

dbeachy1

O-F Administrator
Administrator
Orbiter Contributor
Addon Developer
Donator
Beta Tester
Joined
Jan 14, 2008
Messages
9,151
Reaction score
1,480
Points
203
Location
VA
Website
alteaaerospace.com
Preferred Pronouns
He/Him
@dbeachy1, can you produce an "How-to" about playing mp3 from MFD with XRsound2 Beta please? I haven't found anything in documentation

Check out the XRSound CreateIntance methods in Orbitersdk\XRSound\xrsound.h. The first one is unchanged from XRSound version 1, but the second one is new, and allows you to create an instance of XRSound identified by an arbitrary (but unique within a given Orbiter scenario!) module name rather than an Orbiter vessel instance:

// Create an instance of an XRSound proxy object for the named *module*; invoke this from your module's clbkSimulationStart method.
// pUniqueModuleName: arbitrary name uniquely identifying the calling module; typically, this should match the filename of your Orbiter module DLL, excluding the ".dll" extension.
// Returns: instance of XRSound proxy to use with the specified pUniqueModuleName.
// NOTE: do not forget to delete the returned proxy object when you no longer need it (e.g., in your module's clbkSimulationEnd method).
static XRSound *CreateInstance(const char *pUniqueModuleName);

Since XRSound uses the pUniqueModuleName value to uniquely identify which Orbiter module is calling it, it is best to pass the name of your Orbiter module's DLL here; e.g., if your custom MP3 Orbiter module is installed as MyCoolMp3Player.dll, it's best to pass "MyCoolMp3Player" as the pUniqueModuleName here. As I said, module names are arbitrary, but they must be unique within a given Orbiter installation.

Once you have your XRSound instance from that call, all the other API calls are the same as in XRSound version 1; i.e., you can call LoadWav, PlayWav, StopWav, etc. from your module as you wish.

I keep meaning to release XRSound 2.0, since the 2.0 beta has been around for over a year now. :lol: There have been no code changes since beta 3, so I'll see if I can get version 2.0 released in the near future.

As a side note, XRSound 2.0 is backwards-compatible with XRSound 1.0-enabled vessels as well; i.e., you can use XRSound 1.0 vessels with XRSound 2.0 installed in your Orbiter instance, and everything should work.

Please let me know if you find any bugs when using XRSound from a module (i.e., a non-vessel). :thumbup:

EDIT:
Actually not just MP3 format, but FLAC, Windows stuff and a bunch of other formats should be included as well. My music library is primarily FLAC.

BTW the sound engine that XRSound uses, irrKlang Pro 1.6, supports these sound file formats:

  • RIFF WAVE (*.wav)
  • Ogg Vorbis (*.ogg)
  • MPEG-1 Audio Layer 3 (*.mp3)
  • Free Lossless Audio Codec (*.flac)
  • Amiga Modules (*.mod)
  • Impulse Tracker (*.it)
  • Scream Tracker 3 (*.s3d)
  • Fast Tracker 2 (*.xm)

irrKlang also supports third-party plugins to support additional sound formats as well.
 
Last edited:
Top