# Audio for games - playing music without MIDI support?

**URL:** <https://forum.developer.roku.com/t/audio-for-games-playing-music-without-midi-support/10509>\
**Category:** Archived\
**Tags:** roku-developer-program\
**Created:** [November 28, 2022, 1:07am UTC](https://forum.developer.roku.com/t/audio-for-games-playing-music-without-midi-support/10509 "2022-11-28T01:07:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![EugeneZ](https://avatars.discourse-cdn.com/v4/letter/e/8c91f0/32.png) [@EugeneZ](https://forum.developer.roku.com/u/EugeneZ)\
**Post date:** [November 28, 2022, 1:07am UTC](https://forum.developer.roku.com/t/audio-for-games-playing-music-without-midi-support/10509/1 "2022-11-28T01:07:53Z")

</div>

This question is for people who develop games for ROKU.

When you play a game, typically you have some light motivating music playing in the background.

But ROKU does not support MIDI files.

It does not have a synthesizer, and can’t make a sound of given frequency.

How do you deal with that? Do you just package mp3s with your channels (4MB is the maximum, right?)

You would need about 1MB of mp3 instead of 20K of MIDI.

And “Options sidebar” keeps popping onto the screen if you use mp3 playing facility (Audio or roAudioPlayer).

Is there something better?

Thanks!

---

<div class="post-metadata">

**Author:** ![renojim](https://avatars.discourse-cdn.com/v4/letter/r/ecae2f/32.png) [@renojim](https://forum.developer.roku.com/u/renojim)\
**Post date:** [November 28, 2022, 10:07am UTC](https://forum.developer.roku.com/t/audio-for-games-playing-music-without-midi-support/10509/2 "2022-11-28T10:07:29Z")

</div>

This is a good question for @Romans_I_XVI .

You don’t necessarily have to package the audio file with the app if you can host it somewhere and download it when you channel/app starts. cachefs would be a good place for it.

Do you have **game=1** in your manifest?

---

<div class="post-metadata">

**Author:** ![EugeneZ](https://avatars.discourse-cdn.com/v4/letter/e/8c91f0/32.png) [@EugeneZ](https://forum.developer.roku.com/u/EugeneZ)\
**Post date:** [November 28, 2022, 2:11pm UTC](https://forum.developer.roku.com/t/audio-for-games-playing-music-without-midi-support/10509/3 "2022-11-28T14:11:28Z")

</div>

I was not aware of game=1

Thanks!

---

<div class="post-metadata">

**Author:** ![Romans\_I\_XVI](https://avatars.discourse-cdn.com/v4/letter/r/f6c823/32.png) [@Romans\_I\_XVI](https://forum.developer.roku.com/u/Romans_I_XVI)\
**Post date:** [February 17, 2023, 11:02am UTC](https://forum.developer.roku.com/t/audio-for-games-playing-music-without-midi-support/10509/4 "2023-02-17T11:02:35Z")

</div>

I just saw I was tagged here. I actually just got done figuring out how to include a full soundtrack which was almost 200MB originally. Basically my solution was to use ffmpeg to reduce the file size as much as possible without losing too much quality.

Here’s a good reference document - [https://trac.ffmpeg.org/wiki/Encode/AAC](https://trac.ffmpeg.org/wiki/Encode/AAC)

My best result was accomplished by converting to mono with a 24k bitrate using libfdk and the aac\_he profile. Here’s what I did:

```markup
ffmpeg -i input.ogg -c:a libfdk_aac -vn -ar 44100 -b:a 24k -ac 1 -profile:a aac_he -movflags +faststart output.m4a

```

>

---

<div class="post-metadata">

**Author:** ![necrotek](https://avatars.discourse-cdn.com/v4/letter/n/cc9497/32.png) [@necrotek](https://forum.developer.roku.com/u/necrotek)\
**Post date:** [February 20, 2023, 5:22pm UTC](https://forum.developer.roku.com/t/audio-for-games-playing-music-without-midi-support/10509/5 "2023-02-20T17:22:16Z")

</div>

Years ago I was attempting to build an XM module player. I never got it to work correctly but it does make noise. It would parse the file and generate a short wave file that I would play as an audio resource. At the end of processing the audio I don’t know how much headroom would be available for gameplay though.

In the end my solution is similar to Romans\_I\_XVI. There is always hosting the audio elsewhere, but for a game I would rather have the audio available even if the internet is unavailable.

---

<div class="post-metadata">

**Author:** ![necrotek](https://avatars.discourse-cdn.com/v4/letter/n/cc9497/32.png) [@necrotek](https://forum.developer.roku.com/u/necrotek)\
**Post date:** [February 20, 2023, 5:29pm UTC](https://forum.developer.roku.com/t/audio-for-games-playing-music-without-midi-support/10509/6 "2023-02-20T17:29:42Z")

</div>

The manifest entry for game=1 was supposed to eliminate some audio issues like gaps in sequential playing of audio tracks. I don’t know if it actually fixed anything. Any device after the Roku 3 has had a big gap between audio in a playlist so loops don’t work well.

| game | integer | _Available since Roku OS 9_  
  
All game channels must add the game manifest entry to their manifest file. This flag prevents the channel from having audio/sound effects delays in the game. | game=1 |
| --- | --- | --- | --- |

I have never noticed a sidebar when playing audio player or audio resource.
