Defy PCM Boombox and Audio String Library

Defy Audio Player
The Defy Audio Player plays Defy formatted audio files via PICO-8's PCM channel. It's a PCM boombox! You can also use it to create binary strings of audio data for playback in your own cartridges.
Convert almost any audio file format to .defy here: https:bikibird.itch.iodefy.
This cart is intended to run in PICO-8, not play on the BBS, which is limited to a maximum files size of 250K. Instead, open PICO-8 and enter load #defy. Then enter run.
Controls

Drag and drop your .defy file onto PICO-8 to play it. You do not have to wait for a file to finish before loading another.
Press ?️ (z key) to pause playback. Press it again to resume.
Press ⬅️ or ➡️ to switch visualizers.
Press ⬆️ to eject and stop playback.
Press ⬇️ to display title and format.
Press ❎ to record binary string. If you press record prior to playing the file, Defy will start recording it as soon as the file is dropped. The binary string is copied to your computer's clipboard.

Audio String Player
The library below plays Defy formatted audio strings. For support for @luchak's QPA formatted audio strings see https:www.lexaloffle.combbs?tid=53933 and https:github.comluchakqpa-format.
Warning: Be careful testing new audio strings. Playback with a mismatched playback mode sounds terrible. Do not test with headphones. Protect your hearing.
When record is pressed, the first 32,000 bytes of audio data are copied to the clipboard as a binary string during playback. Use the code below in your own carts to play the binary string. Be aware that only a few seconds of audio will fit in a cart. If the captured string contains too much data, you may truncate it. One second of audio equates to approximately 5500, 2250, 1840, 1125, and 690 characters for 8, 4, 2.6, 2, and 1 bit formats respectively.

Paste the library below into a new cart.
To save tokens, delete defy_play functions for any unused bit formats



Close
Connection Error!

Please check your connection and try again.