Can you use .ogg AND .m4a on Mobile Exports?

Discussion in 'RPG Maker MV Deployment' started by Kudin, Oct 22, 2015.

  1. Kudin

    Kudin Villager Member

    Messages:
    21
    Likes Received:
    5
    First Language:
    English
    Soooooo now that it's been released, can anybody answer this question? :)
     
    #21
  2. Liak

    Liak Veteran Veteran

    Messages:
    1,789
    Likes Received:
    269
    Location:
    Germany
    First Language:
    German
    I have a related question. I hope it's okay to ask it here instead of opening a new topic:

    Why do we have everything as OGG and M4A? So it appears iPhone and iPad can't play OGG (right?), but why can't we just use only the M4a files? I'm asking because especially the music and sound files take up a lot of space.
     
    #22
  3. KisaiTenshi

    KisaiTenshi Veteran Veteran

    Messages:
    310
    Likes Received:
    120
    License issues. There is technically no issue in playing the "AAC" audio inside the M4A(MP4) container, but there are patents on the MP4 container AND the H.264 video codec.

    The hardware decoding on the mobile devices covers this, but doesn't on stand-alone Chromium for the desktop systems. You're not allowed to distribute "mp4 decoders" without paying licensing fees. So Chrome and Firefox use the hardware decoding available on the OS, if it's available. Chromium does not. Therefor node-webkit does not.
     
    Last edited by a moderator: Nov 9, 2015
    #23
  4. Liak

    Liak Veteran Veteran

    Messages:
    1,789
    Likes Received:
    269
    Location:
    Germany
    First Language:
    German
    Ah, I see. So there's not actually a problem in removing the non-supported versions of the files for the respective distribution of the game, right? I make one distribution for iPhone/iPad and remove the OGG files and then make another one for PC where I remove the M4As?
     
    #24
  5. KisaiTenshi

    KisaiTenshi Veteran Veteran

    Messages:
    310
    Likes Received:
    120
    This is what the game engine does:

    AudioManager.audioFileExt = function() { if (WebAudio.canPlayOgg() && !Utils.isMobileDevice()) { return '.ogg'; } else { return '.m4a'; }};AudioManager.shouldUseHtml5Audio = function() { // We use HTML5 Audio to play BGM instead of Web Audio API // because decodeAudioData() is very slow on Android Chrome. return Utils.isAndroidChrome();};AudioManager.createBuffer = function(folder, name) { var ext = this.audioFileExt(); var url = this._path + folder + '/' + encodeURIComponent(name) + ext; if (this.shouldUseHtml5Audio() && folder === 'bgm') { Html5Audio.setup(url); return Html5Audio; } else { return new WebAudio(url); }};A similar thing is done with Video:

    Game_Interpreter.prototype.command261 = function() { if (!$gameMessage.isBusy()) { var name = this._params[0]; if (name.length > 0) { var ext = this.videoFileExt(); Graphics.playVideo('movies/' + name + ext); this.setWaitMode('video'); } this._index++; } return false;};Game_Interpreter.prototype.videoFileExt = function() { if (Graphics.canPlayVideoType('video/webm') && !Utils.isMobileDevice()) { return '.webm'; } else { return '.mp4'; }};Note that specific carve out in the game engine is looking for "can play ogg" and "is a not a mobile device"  to play ogg, otherwise it plays m4a. This implementation is a bit too naive since Chrome and Firefox do support wav as well (which might be preferred for sound effects to reduce audio latency) but then there is this footnote

    Basically there is no guarantee that the browser will have support, so ideally you would test once at game startup if the device can support video and audio formats, then check of those formats of audio exist in your startup sound, which if it fails, you then disable sound playback instead of trying to hamfistedly load the audio every time. Like as an example of this, I did a mobile export that exported m4a and ogg, which the menu worked (because it had no audio) but then threw an error when it displayed the first map because there was no .m4a for that map.
     
    #25
  6. Otolitywi

    Otolitywi Warper Member

    Messages:
    2
    Likes Received:
    0
    First Language:
    English
    Primarily Uses:
    Other
    HI MAN,
    I think you can not make a mixture of M4A and OGG because they support by different coding, M4A is seldom compatible with devices except for Apple devices. If you want to play audio on devices other than Apple, then you’d better transfer M4A audio to WAV. Compared with M4A to MP3, M4A audio to WAV can keep the original audio quality. more info you can view: http://www.videoconverterfactory.com/tips/m4a-to-waspamwebsite.comml As for OGG, the Ogg container format can multiplex a number of independent streams for audio, video, text, and metadata. more info: https://en.wikipedia.org/wiki/Advanced_Audio_Coding In fact WAV is good enough for most audio
     
    #26
  7. Kes

    Kes Global Moderators Global Mod

    Messages:
    20,612
    Likes Received:
    10,514
    First Language:
    English
    Primarily Uses:
    RMVXA
    Are you sure that MV supports WAV? I think it doesn't, but I may be wrong.
     
    #27
  8. Otolitywi

    Otolitywi Warper Member

    Messages:
    2
    Likes Received:
    0
    First Language:
    English
    Primarily Uses:
    Other
    yes, WAV can be supported, amny people will think that MP3 is compatible, acctually WAV too
     
    #28
  9. Nza3

    Nza3 Villager Member

    Messages:
    29
    Likes Received:
    1
    First Language:
    english
    Primarily Uses:
    RMMV
    All I can say is if you are deploying your game to Android, make sure to have BOTH .ogg and .m4a files, and DO NOT, DO NOT, DO NOT have mp3 files. This will fudge up your game when the files are being loaded unless you've configured it to be able to load mp3 files.

    Sorry if it wasn't much help. But that's my experience. I had errors exporting my game to android, (and I'm still having errors with plugins, but at least now it starts and is fully playable) when I tried to use only .ogg or only .m4a files, and when I had lingering .mp3 files.

    Hope it helped
     
    #29
  10. corthew

    corthew Warper Member

    Messages:
    2
    Likes Received:
    0
    First Language:
    English
    Primarily Uses:
    RMMV
    So why don't they just set it up from the start to use a format that works across the board on all devices. Wav is out of course because, dayum they're big. Mp3 on the other-hand is not and I'm not aware of a system that won't play them. Its the most used and distributed music format out there. I play them on my Iphone, my son on his Android, we play them on PC's and I'm pretty sure if Iphone plays them Mac does as well.
    It just sounds like they've chosen two formats that have serious limits to what they can play on and that really seems silly to me when Mp3 is an option.
     
    #30
  11. Andar

    Andar Veteran Veteran

    Messages:
    28,348
    Likes Received:
    6,453
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    Unfortunately that is not an option, because we are not talking about personal use here.

    There are only two options for companies who want to sell something in cases like this:
    1) go with the Codecs that are included with the target system.
    2) pay for Codecs that you have included yourself.

    iOS and Android have different Codecs included, that is the reason why RMMV needs two different formats for its audios, if they had included their own Codecs they would have had to pay for every copy of MV sold, and quite a lot because MV is an engine to produce commercial games (which would have needed to play their own licence fees as well).

    And no, MP3 is not an option at all. Just because personal use of mp3 is free does not mean that commercial distribution of a mp3 codec is free as well - Kodakawa would have had to pay for a mp3-distribution licence if they had used that.
     
    #31

Share This Page