One of my long term goals for the site (several months) was to allow users to submit text and generate their own morse code ringtones. I thought I'd start working on it and maybe a few months down the road I'd have the feature ready to launch. Well, It's Monday, the domain was registered Friday and I've already got the script together. As I worked on some things over the weekend it dawned on me that it might be an easier scripting task than I thought.
It turns out it was a fairly manageable scripting task. I've limited the script in a number of ways. For one, the only characters that will be encoded into morse should be the letters a-z and numbers 0-9. Any spaces in the text are converted to underscores (for the file name, they're kept intact for the morse text). I've also enabled the use of prosigns (anything enclosed within angle brackets will be "smushed" together to make a prosign like <SK> )
I really have a lot of programmers to thank for providing wonderful free (open source) tools for the creation of such things, but I should give thanks to the writer of ebook2cw. This fantastic tool has made it possible to create mp3 files directly from input text (and supports the use of prosigns.) Now, while ebook2cw supports extended characters such as accented characters and ñ and umlauted characters, etc.... I've not allowed that functionality in part due to restrictions in passing variables to the script from the web interface.
I also have truncated the file names to 35 characters, so even if you put in a really really long bit of text for the code, you'll get a shorter file name and the long text should still be used to generate the ringtone. I should point out that most phones limit ringtones to about 30 seconds so don't try to load war and peace in there. (You'll get a VERY big mp3 file...) (Yes, I've limited the length of text as well, but it's not as short as the filename needs to be.)
For now, I've kept four speed settings (slow 5WPM/12 Farnsworth, medium 12WPM/18 Farnsworth, fast 18WPM and veryfast 20WPM). In the future I expect to be adding some faster speeds. Because after all this work, the 18WPM is not seeming too fast anymore...
I've also added an option to play with the output frequency. The default is 800 hz and is the same frequency that most of the rest of the site is generated at, but I personally find a 600 hz tone a bit more pleasing. The reason I settled on 800hz for the ringtones is... well, it's supposed to get your attention, not be something to sit and listen to for hours on end. I thought the higher pitch had a bit more shrill "bite" to it. That much said, some people may hear other frequencies better than others.... so feel free to experiment.
In addition to the ability to create new morse code mp3 ringtones, I've also added a way that you can see what ringtones other people are making, the user submitted mp3 ring tone page will maintain the links to yours and others submissions. It may not be kept permanently, who knows I may need to flush it from time to time, but at this point I intend to keep them around and integrate the best suggestions back into the main site.
Thanks for stopping by!
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment