scp93ch / morse-pro

Library for manipulating Morse code text and sound. Understands prosigns and Farnsworth speed. Can create WAV files and analyse input from the microphone or audio files.
European Union Public License 1.2
118 stars 29 forks source link

Downloaded File Names #2

Closed yottalogical closed 5 years ago

yottalogical commented 6 years ago

It would be useful for the file names of downloaded morse audio to be what the morse means. Right now they are all morse.wav. This makes it impossible to manage multiple morse audio files at once.

scp93ch commented 6 years ago

Sorry for the slow reply. I'm not sure what code you are using to cause the filenames to be the same. I don't think that's part of the library is it?

The way I use it is something like:

<a role="button" id="download" download="morse.wav">Download</a>

Using jQuery you can change the download property to be whatever filename you want:

$download = $('#download');
$download.attr("href", getDataURI(RiffWave.getData(morseCWWave), RiffWave.getMIMEType()));
$download.prop("download", "filename.xyz");

I hope that helps?