? Importing waveforms from a PC to SB ● SmileBASIC Source

Sign In

Register
*Usernames are case-sensitive
Forgot my password
Creep into the Halloween / Horror Programming Contest (Deadline Extended)

Importing waveforms from a PC to SB

List of sections
  1. Before Starting
  2. Preparing your audio file
  3. Exporting audio to SmileBASIC format
  4. Known bugs of the tool

Before Starting

Before staring, make sure you have the following: SmileBASIC File Manager Wav Recorder A audio managing tool. (I used Audacity for this tutorial) A PC with Windows installed on it. (you may be able to use Mono on Linux to run this but IDK) Download the WAV2SBWAV tool from here.

Preparing your audio file

Open your audio file in Audacity, and first, set the sample rate to 8180. (there is no option for 8180 but you can write it there manually) Next, make the audio track mono via Tracks->Stereo Track to Mono. Finally, select File->Export Audio. On the save dialog, set the save format to be Other uncompressed formats and then select Options. Set the settings to be WAV (Microsoft) and Unsigned 8-Bit PCM. Now save the new file as anything.

Exporting audio to SmileBASIC format

Open the WAV2SBWAV tool. Select Load WAV and then select the file made earlier. (if the WAV file's length is over 30s, tick Ignore sample count) After it's done writing the data, select Save SBWAV and save it anywhere you want to. To see how to import the file to SB, see this. Make sure the filename starts with B and is UPPERCASE

Known bugs(?) of the tool:

  1. The tool apparently overwrites the footer a bit, but that really shouldn't be a problem.
  2. The date is totally wrong. I might change it to use the current time & date.
  3. Ticking "Ignore sample count" makes it also ignore the sample rate. I haven't tested yet what happens when you play a file like that, but I don't think it'll make the wavplayer library explode/freak out/fly to space.
Author
Perska
Updated
Rating
7 votes
Categories
Keywords
  • wav2sbwav
  • import
  • waveform
35 Comment(s) h267 h267 RNG Hidden Easter Eggs Pokemon Is Awesome! I love Pokemon! Express Yourself Good Page Hidden Achievements Wouldn't it also be better to not pack a single byte into a 4-byte integer? Instead, you could make it store 4 different bytes in one integer, cutting the size four fold. Reading 4 bytes from a 32 bit integer shouldn't be difficult if you write a small code snippet to put on the page. I should be able to pack in 8 minutes of audio instead of 2. 12Me21 12Me21 Admin Syntax Highlighter Received for creating the code syntax highlighter on SBS because then you need to decompress it which is annoying h267 h267 RNG Hidden Easter Eggs Pokemon Is Awesome! I love Pokemon! Express Yourself Good Page Hidden Achievements But is that really worth a 4x file size inflation? Maybe there could at least be a toggle for compression. h267 h267 RNG Hidden Easter Eggs Pokemon Is Awesome! I love Pokemon! Express Yourself Good Page Hidden Achievements Though I guess I forgot about compressing it through SB itself. Still, the option would be helpful. h267 h267 RNG Hidden Easter Eggs Pokemon Is Awesome! I love Pokemon! Express Yourself Good Page Hidden Achievements Can you make a 32 bit version of wav2sbwav? Perska Perska Summer 2016 Contest Winner I won the SmileBASICSource Summer 2016 Contest! Programming Contest Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength RNG Hidden Easter Eggs it is h267 h267 RNG Hidden Easter Eggs Pokemon Is Awesome! I love Pokemon! Express Yourself Good Page Hidden Achievements Well I'm having trouble running it then :/ Perska Perska Summer 2016 Contest Winner I won the SmileBASICSource Summer 2016 Contest! Programming Contest Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength RNG Hidden Easter Eggs What does the program throw at you when you run the executable? h267 h267 RNG Hidden Easter Eggs Pokemon Is Awesome! I love Pokemon! Express Yourself Good Page Hidden Achievements *path* is not a valid Win32 application. Midnoclose Midnoclose Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself Night Person I like the quiet night and sleep late. Express Yourself Video Games I like to play video games! Hobbies It won't let me change the rate to 8180 12Me21 12Me21 Admin Syntax Highlighter Received for creating the code syntax highlighter on SBS You have to type the 1 on the number pad for some reason. Midnoclose Midnoclose Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself Night Person I like the quiet night and sleep late. Express Yourself Video Games I like to play video games! Hobbies Sucs I don't have a number pad on my keyboard 12Me21 12Me21 Admin Syntax Highlighter Received for creating the code syntax highlighter on SBS I think you can copy/paste "8180" into the input box Midnoclose Midnoclose Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself Night Person I like the quiet night and sleep late. Express Yourself Video Games I like to play video games! Hobbies Tried that too. :C Midnoclose Midnoclose Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself Night Person I like the quiet night and sleep late. Express Yourself Video Games I like to play video games! Hobbies In the preferences make 8180 the default 12Me21 12Me21 Admin Syntax Highlighter Received for creating the code syntax highlighter on SBS Windows 10 thinks this is a dangerous virus! I somehow managed to fix it by opening the EXE in notepad++ and changing this line: <assemblyIdentity version="1.0.0.0" name="MyApplication.app"/> I changed the name to "WAV TO SB WAV.app" (same length) and now it works fine 10/10 best security mia mia Day Person I like the warm sunshine and wake up early! Express Yourself Banana For Scale Hidden Easter Eggs Night Person I like the quiet night and sleep late. Express Yourself Mine thought it was okay... but I didn't get to actually do it. For some reason, the outputs kept becoming aiff or something. mia mia Day Person I like the warm sunshine and wake up early! Express Yourself Banana For Scale Hidden Easter Eggs Night Person I like the quiet night and sleep late. Express Yourself The song became.. very disturbing in my opinion.. Awesome! It made me remember how slowing songs down gives them new meaning~? Why.. does Audacity keep saving it as an AIFF.. UNDERTALE does it a few times which I think is cool, too. Sam Sam Amazing Page Hidden Achievements Summer 2016 Contest Runner Up I placed 2nd in the SmileBASIC Source Summer 2016 Contest! Programming Contest Winter 2016 Contest Runner Up I placed 2nd in the SmileBASIC Source Winter 2016 Contest! Programming Contest Is the SBWAV file what I'm supposed to send through Petit Modem? Please enlighten me or something, I'd like to send WAV files with Petit Modem. Perska Perska Summer 2016 Contest Winner I won the SmileBASICSource Summer 2016 Contest! Programming Contest Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength RNG Hidden Easter Eggs The program generates a file to be sent with homebrew, as I have no idea what the format that Petit Modem uses is. If I figure out the format, I could simply make it compatitle with Petit Modem. 12Me21 12Me21 Admin Syntax Highlighter Received for creating the code syntax highlighter on SBS convert to text file perhaps? That's what I did to send image files. Super_Defaultio Super_Defaultio First Month Joined in the very first month of SmileBASIC Source Website Beginner Programmer I'm just starting out! I'm still trying to grasp the basics. Programming Strength Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself Petit modem can convert the following as of this moment : BMP/PNG/GIF/JPG into a .PZG file, TXT into .PZT file, and DAT into .PDA It cannot convert any other file, but you can send it raw without conversion... just convert into a wav file for petit modem simplex receiver to use... 12Me21 12Me21 Admin Syntax Highlighter Received for creating the code syntax highlighter on SBS Please add tags such as "WAV2SBWAV" , so we can find it more easily. Perska Perska Summer 2016 Contest Winner I won the SmileBASICSource Summer 2016 Contest! Programming Contest Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength RNG Hidden Easter Eggs "wav2sbwav" is already there. What kind of other tags there should be? 12Me21 12Me21 Admin Syntax Highlighter Received for creating the code syntax highlighter on SBS WAV SBWAV 12Me21 12Me21 Admin Syntax Highlighter Received for creating the code syntax highlighter on SBS thank you JKNXD3QV mystman12 mystman12 First Day Joined on the very first day of SmileBASIC Source Website Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Video Games I like to play video games! Hobbies Hold on, I didn't realize this required homebrew... Would it be possible to use P/SEND (http://myu314.org/studyroom/product/pisend2/) to transfer the output file into SmileBASIC? Perska Perska Summer 2016 Contest Winner I won the SmileBASICSource Summer 2016 Contest! Programming Contest Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength RNG Hidden Easter Eggs I don't know. Maybe you can use Petit Modem with this if you do some modifications to the code to save the output file to the format it uses? AnswerXOX AnswerXOX Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength Great Page Hidden Achievements Pokemon Is Awesome! I love Pokemon! Express Yourself Good job, exactly what I've been looking for! mystman12 mystman12 First Day Joined on the very first day of SmileBASIC Source Website Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Video Games I like to play video games! Hobbies Nice! I've wanted a good way to transfer audio from my PC, this looks like it will work great! Trinitro21 Trinitro21 First Week Joined in the very first week of SmileBASIC Source Website Query Denied Hidden Easter Eggs Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength Works really well! Good job! Perska Perska Summer 2016 Contest Winner I won the SmileBASICSource Summer 2016 Contest! Programming Contest Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength RNG Hidden Easter Eggs Should've mentioned this too: if the WAV file is over 30s, it won't play normally on the wavplayer. You can go around this by making it use integers instead of floats. While this does not remove the limit fully, it gives extra memory for more audio or your whatever variables. You can always split the waveform too. Mattshark Mattshark How exactly would I make it "use integers instead of floats"? I know what they both mean, I just don't know exactly what I'm changing... Perska Perska Summer 2016 Contest Winner I won the SmileBASICSource Summer 2016 Contest! Programming Contest Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength RNG Hidden Easter Eggs You can add OPTION DEFINT to the wavplayer library which defaults every variable without a suffix to be treated as a integer. You also should load the wav file in your program to a int array.DIM ARRAY%[0] LOAD "DAT:MYWAV.WAV",ARRAY%,0 (or you could use the WAVSTART command, too!) Mattshark Mattshark So If all my audio is doing is static-ing for a second before jumping to a high pitch whine, then fading away, I didn't create the file right? :P