1

I have found a website and generated some MIDI base64 string:

data:audio/midi;base64,TVRoZAAAAAYAAAABAeBNVHJrAAAA5wD/WAQEAhgIAP9RAwehIADAAADAAGWQXH8AwABlgFx/AMAAZZBZfwDAAGWAWX8AwABlkFZ/AMAAZYBWfwDAAGWQQ38AkEF/AJBCfwCQQH8AkD9/AMlPAJlPfwDAAACQU38AwABlgEN/AMAAZYBCfwDAAGWAP38AwABlgFN/AMAAZZBDfwDJTwCZT38AwAAAkFB/AMAAZYBBfwDAAGWJT38AwABliQB/AMAAZcAAZYBAfwDAAGWAUH8AwABlkE1/AMAAZYBDfwDAAGXAAGWATX8AwABlwABlwABlwABlwABlkDh/AP8vAA==

But I found it's not able to play via the audio tag. Is it possible for me to play that?

AGamePlayer
  • 7,404
  • 19
  • 62
  • 119
  • 1
    You can use this jquery plugin https://github.com/rism-ch/midi-player and check this https://stackoverflow.com/questions/14168093/midi-music-support-in-html5 – Jagjeet Singh Jun 30 '18 at 04:11

2 Answers2

1

use https://github.com/surikov/webaudiofont the project consists of 2000 digitized instrument and examples for produce single wave, chord, melody, midi file.

user1024
  • 1,121
  • 1
  • 9
  • 17
0

You can play midi base64 strings with this javascript library https://github.com/mudcube/MIDI.js The MIDI Player code example does exact what you want.

when i do

player.loadFile(MIDI_BASE64_STRING, player.start);

I can hear the sound of the song. The .mid file is hardcoded into a base64 string named MIDI_BASE64_STRING in the code.

Ege
  • 138
  • 1
  • 14