How to export a pitched source/audio file
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- PixliiTheGreat
- Prole
- Posts: 3
- Joined: Tue Aug 02, 2022 12:14 am
How to export a pitched source/audio file
Hi, I'm fairly new to LÖVE developing and i'm trying to make a script that pitches a sample up and then exports it into a folder. I'm having trouble exporting the sound. I'm aware of the Source:setPitch script, but I'm not sure how to export the pitched file. If anyone could help, I would be immensely grateful. Thanks!
Re: How to export a pitched source/audio file
There's currently no function in LÖVE for saving audio files. You'll have to use a library or roll your own solution.
Tools: Hot Particles, LuaPreprocess, InputField, (more) Games: Momento Temporis
"If each mistake being made is a new one, then progress is being made."
"If each mistake being made is a new one, then progress is being made."
- zorg
- Party member
- Posts: 3470
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: How to export a pitched source/audio file
To be more on point, you can't get back audio (that you applied effects to) from a Source object.
You would need to implement your own pitch changing algorithm, modify all samplepoints in a SoundData object instead, and then write all of that out to disk, encoded in the format of your choice (again, you'd need to implement the encoder as well; wav is the simplest to do.)
Why do you want to export these though?
You would need to implement your own pitch changing algorithm, modify all samplepoints in a SoundData object instead, and then write all of that out to disk, encoded in the format of your choice (again, you'd need to implement the encoder as well; wav is the simplest to do.)
Why do you want to export these though?
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.
- PixliiTheGreat
- Prole
- Posts: 3
- Joined: Tue Aug 02, 2022 12:14 am
Re: How to export a pitched source/audio file
Trying to make a chromatic scale generator for music to be used in FL Studio or smth like that.
- PixliiTheGreat
- Prole
- Posts: 3
- Joined: Tue Aug 02, 2022 12:14 am
Re: How to export a pitched source/audio file
Looks good. Thanks a lot!
Re: How to export a pitched source/audio file
What are the advantages of luawav over the built-in SoundData that zorg mentioned?
Re: How to export a pitched source/audio file
Encoding the wav file...
Tools: Hot Particles, LuaPreprocess, InputField, (more) Games: Momento Temporis
"If each mistake being made is a new one, then progress is being made."
"If each mistake being made is a new one, then progress is being made."
Re: How to export a pitched source/audio file
Oh, you're right, I didn't notice that there's no audio encoder in SoundData.
Re: How to export a pitched source/audio file
IMO, there really should be, since you can generate sound and even record sound from a mic, and you can encode images.
Tools: Hot Particles, LuaPreprocess, InputField, (more) Games: Momento Temporis
"If each mistake being made is a new one, then progress is being made."
"If each mistake being made is a new one, then progress is being made."
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot], Semrush [Bot] and 7 guests