WAV to NES converter

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
WAV to NES converter
by on (#90799)
i was just tinkering with PCM playing code and ended up writing a program that converts WAV audio files into a NES ROM that does nothing but play the data. i'm working on some additional features, and i'll upload the converter soon, not sure if there's much interest in it or anything.

here's a sample output ROM to demonstrate it. run it in nintendulator or nestopia for best results. the pitch is quite a bit lower than it should be if using FCEUX.

http://rubbermallet.org/wav2nes-sample.nes

by on (#90817)
Nifty. I might be interested in inserting audio into an existing game down the road.

by on (#90820)
So is the size dependent on the .wav file? Or does it always pump out huge files? Seems like it would be difficult to implement in a game with close to 512KB of music data.

Is it always set to MMC3? or are you able to use any mapper that can store that much data?

Either way pretty cool though even to just play around with. I'd be interested in seeing a release. nice work!

by on (#90826)
Works nicely with RockNES.

by on (#90836)
infiniteneslives wrote:
So is the size dependent on the .wav file? Or does it always pump out huge files? Seems like it would be difficult to implement in a game with close to 512KB of music data.

Is it always set to MMC3? or are you able to use any mapper that can store that much data?

Either way pretty cool though even to just play around with. I'd be interested in seeing a release. nice work!


nope, it just depends on the WAV length. i'm converting to 18000 Hz output but i'll make that changeable. i only wrote code to do MMC3, but there is no reason it couldn't use other mappers.

i'll provide the player code too. it's really simple as you might imagine.

by on (#90838)
Zepper wrote:
Works nicely with RockNES.


just tried it, yeah nice work on that it's perfect.

by on (#90843)
Sunsoft's FME7 and ROM with bankswitching 8-bit PCM At $6000-$7FFF should help a lot in most cases, especially when it comes to music or samples...

There is another method without stopping gameplay and stuff: a 7-bit DMC/DPCM Option, but it will lose quality.

Also there is ROM Size to consider, There is 32kb of ROM Max for most mappers along with bankswitching, so real consoles do not have this, emulators do!

So you are in a (Fuzzy) Pickle unless you do a mapper of your own, example given earlier by Tepples: Moero! Pro Yakyuu (Japanese Bases Loaded).

by on (#90935)
Hamtaro126 wrote:
Sunsoft's FME7 and ROM with bankswitching 8-bit PCM At $6000-$7FFF should help a lot in most cases, especially when it comes to music or samples...

There is another method without stopping gameplay and stuff: a 7-bit DMC/DPCM Option, but it will lose quality.

Also there is ROM Size to consider, There is 32kb of ROM Max for most mappers along with bankswitching, so real consoles do not have this, emulators do!

So you are in a (Fuzzy) Pickle unless you do a mapper of your own, example given earlier by Tepples: Moero! Pro Yakyuu (Japanese Bases Loaded).


yeah, my music sample ROM is very impractical for a game but it's just to demonstrate it. it would be great for short samples though. say, something at the end of a level or during a title screen, or something similar. my example being 18000 Hz sample rate is also impractical. :)

by on (#90960)
miker00lz wrote:
it would be great for short samples though. say, something at the end of a level or during a title screen, or something similar.


I really like that idea! I had passed it as total impractical in a game, but it would make for a great wow factor on a title screen.

by on (#90963)
infiniteneslives wrote:
I had passed it as total impractical in a game, but it would make for a great wow factor on a title screen.

A lot of other developers have had the same idea:
  • Wheel of Fortune and Skate or Die 2 both have a title scream. Action 52 has a sampled theme song and "Make your selection now" speech on the title screen.
  • The first Castlevania game for GBA uses an 8-bit LPCM stream on the title screen and sequenced music elsewhere.
  • Animal Crossing: Wild World for DS uses a pair of 4-bit ADPCM streams (one for each channel) on the title screen and sequenced music elsewhere.

by on (#90966)
yeah, this isn't a new idea or anything but i didn't seem to be able to find an existing program to do this.
Re: WAV to NES converter
by on (#149330)
I'm aware that posting to a 3 year old topic is not the best idea, but does anybody know what is the original track's name what is in this ROM?
It says something like: "I'm back in the sea, I'm not gonna see...", but I couldn't find any track, or even lyrics with that.
Re: WAV to NES converter
by on (#149336)
MrNorbert1994 wrote:
I'm aware that posting to a 3 year old topic is not the best idea, but does anybody know what is the original track's name what is in this ROM?
It says something like: "I'm back in the sea, I'm not gonna see...", but I couldn't find any track, or even lyrics with that.

Genesis - Dodo / Lurker (Three Sides Live) HQ