Jump to content


Photo

Audio in GMS


  • Please log in to reply
10 replies to this topic

#1 Chromo

Chromo

    GMC Member

  • New Member
  • 17 posts
  • Version:Unknown

Posted 13 January 2012 - 11:30 AM

in Stealth Bastard I used GMFMODSimple to play .ogg files for the following reasons:
  • The music tracks are long and needed to be compressed, but the .mp3 playback in GM had a performance hit
  • I wanted to pitch shift some of the sound (although I did a lot less of this than I planned in the end)
  • I was wary of the .mp3 licensing issue

I notice that GMS (and HTML5, I'm guessing?) now supports .ogg playback, and also transcodes the audio to .mp3 and .ogg on compile. So my questions are:
  • Is the performance hit from the original GM gone?
  • Is it best to add the files into the main GMX project directly as .ogg (or .mp3 even)?

Cheers.
  • 0

#2

  • Guests

Posted 13 January 2012 - 11:56 AM

MP3 is the only thing fully supported on the various devices, so you'll have to swap to that for now. Down the line, we'll add auto-conversion just like the HTML5 version does, but for now you'd need to use MP3s.

As for the ogg in HTML5, this is simply because other browsers don't support MP3 so we have to use ogg, but there's currently no "ogg" playing support in native runners.

On devices, MP3 playback should be very cheap. I've never notice a performance hit for playing sounds.

Just add the sounds as MP3s, and play them as normal, and GameMaker will do the rest.

#3 Chromo

Chromo

    GMC Member

  • New Member
  • 17 posts
  • Version:Unknown

Posted 13 January 2012 - 12:02 PM

Thanks, Mike. Will head in that direction.
  • 0

#4 xot

xot

    media multimixer

  • Global Moderators
  • 4648 posts
  • Version:GM:Studio

Posted 20 January 2012 - 04:27 PM

Off Topic: Stealth Bastard is truly awe-inspiring. Amazing work.
  • 0

#5 Chromo

Chromo

    GMC Member

  • New Member
  • 17 posts
  • Version:Unknown

Posted 01 February 2012 - 01:36 PM

Off Topic: Stealth Bastard is truly awe-inspiring. Amazing work.


(Just noticed this...)

Ha, thanks, Xot. Really nice to hear you enjoyed it. :)
  • 0

#6 Sindarin

Sindarin

    Indie Game Developer

  • New Member
  • 1644 posts
  • Version:GM:HTML5

Posted 06 February 2012 - 04:03 PM

Just add the sounds as MP3s, and play them as normal, and GameMaker will do the rest.


The problems I have with MP3s are 3,
first the licensing in cause you need to sell your game,
second MP3s don't loop too well,
and finally I believe GM uses MP3 codecs, as opposed to an audio library, which they don't come with some Windows XP & Vista installations.

I noticed you're experimenting with OpenAL on the Windows C++ runner?
Is there a possibility that OGG will be available in GM Studio if you make it in the timeframe?

Edited by Sindarin, 06 February 2012 - 04:04 PM.

  • 0

#7 Mike.Dailly

Mike.Dailly

    Evil YoYo Games Employee

  • Administrators
  • 1483 posts
  • Version:GM:Studio

Posted 08 February 2012 - 01:31 PM

You do not need a license if you use the Public APIs on the various devices. Microsoft+Apple pay for the whole device, and as long as you don't have your own decoder you are fine. Android I suspect will do the same as they have "public" mp3 playback APIs.

We have no issue with the MP3 looping on the devices. No, we won't be adding OGG to the GM:Studio, only in GM9 time frame.

The C++ Runner spawns it out to the media player, meaning again, we're using Microsoft's player, and they pay the license to decode.
  • 0

#8 gnysek

gnysek

    GMC Member

  • GMC Member
  • 318 posts
  • Version:GM:Studio

Posted 12 February 2012 - 09:45 PM

It means that MP3 created by GameMaker can be played without any licence, but what with case when I prepare MP3 (for example in AudaCity, or in FruityLoops) - I need to have licence to export my music to MP3 which will be used commercially, right? Cause I can playback it without own licence, it's on device.

Edited by gnysek, 12 February 2012 - 09:45 PM.

  • 0

#9 Sindarin

Sindarin

    Indie Game Developer

  • New Member
  • 1644 posts
  • Version:GM:HTML5

Posted 13 February 2012 - 11:37 AM

meaning again, we're using Microsoft's player, and they pay the license to decode.


Okay, I laughed a little at this phrase like "Poor Microsoft..." xD

However the media player has its limitations. Like the one MP3 must be playing at once, no sound effects etc.
And like gnysek said, the whole MP3 licensing thing is a nightmare, there are so many pitfalls.

I'd be more happy to see GameMaker's sound pipeline designed to convert everything to OGG. Like e.g.

User loads a new sound > Open File (Available formats: OGG, MP3, WAV, AIFF, FLAC etc.)
The sound gets loaded and converted automatically to OGG by ffmpeg, whatever the format is (except if already OGG) and then placed in the gmx sound directory.
Then the sound is played through OpenAL. You don't need abstraction layers for DirectSound or to worry about MP3s and stuff because all is OGG format.

In case of browsers, the very first time the game is run/exported as HTML5 the OGG sounds are also converted to MP3s, otherwise nothing is converted to MP3s.

Also from another bug report, I mentioned MP3s have "built-in" gaps making seamless looping nearly impossible. OGGs do not have that by default. (More info http://en.wikipedia....apless_playback )
This mostly depends on the sound editor I believe, but the majority of them always add these gaps. Don't know if the current setup of ffmpeg with GameMaker adds them as well but I suppose it does.
I have even searched and found an utility that makes seamless MP3 loops because I had a problem in the past with Flash that could not load OGG loops.

Edited by Sindarin, 13 February 2012 - 11:42 AM.

  • 0

#10 Mike.Dailly

Mike.Dailly

    Evil YoYo Games Employee

  • Administrators
  • 1483 posts
  • Version:GM:Studio

Posted 14 February 2012 - 11:46 AM

Until GM9, we won't be rewriting the Audio. For GM9, it's being shot, hit with an axe, stabbed, hung drawn and quartered, burned, and then buried in an unmarked grave.
  • 1

#11 Sindarin

Sindarin

    Indie Game Developer

  • New Member
  • 1644 posts
  • Version:GM:HTML5

Posted 14 February 2012 - 02:40 PM

Until GM9, we won't be rewriting the Audio. For GM9, it's being shot, hit with an axe, stabbed, hung drawn and quartered, burned, and then buried in an unmarked grave.


The King is pleased.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users