![]() |
Forum Index : Microcontroller and PC projects : Sound in dos mmbasic
Author | Message | ||||
busa Regular Member ![]() Joined: 12/02/2015 Location: AustraliaPosts: 81 |
Hi all, Is it possible to play a sound file from within DOS MMBasic ver 5.05.01 I have searched the forum and the manual but no luck with either. Regards busa |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
You can use the SYSTEM command to do anything in DOS You need to use a suitable player to play WAV or MP3 files but if you want the create your own sounds on the fly it's a bit harder. Jim VK7JH MMedit |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
This might help. It only plays WAV files, not MP3 Put the exe file in the same folder as your MMbasic file or include the full path to the exe. I tried to emulate the MMbasic PLAY command. MMextra.zip Jim VK7JH MMedit |
||||
busa Regular Member ![]() Joined: 12/02/2015 Location: AustraliaPosts: 81 |
Thanks Jim, don't know how you did that but it seems to work well. Will play around with it some more tonight. ![]() |
||||
Quazee137![]() Guru ![]() Joined: 07/08/2016 Location: United StatesPosts: 593 |
Does W10 have the CLI play? MS has added a lot of LINUX functionality in the last few years. open CMD and try "play -h". If its there you can use most sound files even music. |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
No - no play in W10. There might be something in powershell. I don't like powershell. Win XP and earlier did have a simple to use command line sound program but MS decided we didn't need it any more. Ubuntu on Windows doesn't either but could be added I assume. I haven't played with audio in that configuration. The program MMextra has the ability to play 'sounds' not just WAV files so is closer to MMBasic. I will add stereo and few sound effects sometime. Jim VK7JH MMedit |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
I have been playing again. Sounds are now in stereo and there are a few different sound effects. Hopefully self explanatory The programs first generates the waveform and then plays it. This means that continuous play is not an option. Nor is changing frequency on the fly like micromites can. It also means that if you specify a long duration, there will be a noticeable delay before the sound starts playing. MMextra.zip The sound generating routines I used were coded by BasicallyPure on the PureBasic forum. I tweaked it into stereo. Jim VK7JH MMedit |
||||
busa Regular Member ![]() Joined: 12/02/2015 Location: AustraliaPosts: 81 |
Thanks again Jim, that's better than I had hoped for. It's going to keep me busy while I play (pun intended) around with it. ![]() |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |