Is it possible to store a sounddata object to the disk?
I know it has a getString() method, but how would I recreate the sound data using the string data?
Thanks
[Help Please] Sound data and files
Re: [Help Please] Sound data and files
You would need to copy it byte by byte into memory of a new empty sounds data object using FFI.
You can try using codecs or PCM wav libraries for saving normal audio files.
You can try using codecs or PCM wav libraries for saving normal audio files.
Re: [Help Please] Sound data and files
Ok thanks, that sounds doable... I think I can figure out how to work this... Would I need to use the pointer data or what? I haven't really used the FFI library before. Any tips or examples of something like this being done?
- zorg
- Party member
- Posts: 3468
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: [Help Please] Sound data and files
To clarify things a bit, you could do SoundData:getString(), and then write out that whole string into a file... thing is, it would just be a raw dump of bytes (or words, depending on whether the sounddata was 8 or 16 bit); some programs can open such raw files, but most can't.
As raidho said, löve doesn't have a way to encode sound into a playable format, however, finding or even writing a wav (riff/pcm that is) exporter is not too complicated.
As raidho said, löve doesn't have a way to encode sound into a playable format, however, finding or even writing a wav (riff/pcm that is) exporter is not too complicated.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Re: [Help Please] Sound data and files
hmm... Ill look into it thanks for the replies Ill post what I come up with on the forums
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: [Help Please] Sound data and files
Though I can't help but wonder how you got the SoundData in the first place...
Re: [Help Please] Sound data and files
Oh I am using the love-microphone module that someone created and I can play back the audio while it is in memory, but I wanted people to be able to save the audio as well. https://love2d.org/forums/viewtopic.php ... 24#p180124
Who is online
Users browsing this forum: Bing [Bot] and 6 guests