Hello, I am currently making a multiplayer horror game in which one of the monsters records a player’s mic audio and plays it back after a while. The mechanic sorta works like a parrot on how the parrot hears a sound and is able to repeat that sound over and over almost perfectly.
My issue is I have the recording, file saving, and randomly playing the audio done, I just cant make the files overwrite the old ones. How my current idea works is I have 5 blank sound wave files all titles VC#, with the # being from 0-4, and as the player talks into the mic, it will replace the audio files in order and the monster will randomly play one after a while.
If any extra information is needed, i will be happy to provide, if possible. And I’m asking for either a fix to my code, or, if needed, a whole new way of programming this.
For clarification, the specific issue you are unable to save over the previous recorded files? Does the code cease to function or is it simply that the files will not replace despite running.
How are you keeping track of your audio files? Are you adding them to an array of some sort upon creation or are these already accounted for in your code/game files?
Would you mind sharing your blueprints/code so we can get a better look at them?
Any additional specifics you provide may go a long way in solving your problem!
The code does not replace the sound wave files at all. Even if I reload the game, it will stay as the same original audio files without being overwritten. Sorry that I failed to mention this in the original post, but, the sound wave files all contain audio of me saying a number 1-5 (in VC0, I say 1, in VC1, I say 2, etc.).
I currently have a folder within my game files that stores all 5 of the sound wave files and I play the audio files through a “random” node inside a sound cue.
And I would but if i try to upload the video, I get an error saying “New users cannot upload files”. There is quite a bit of code. I will definitely upload once I can!
If the audio files are not being overwritten because they are preset, have you tried dynamically creating those files? Till you can upload what you have so far, check out this non-Epic affiliated tutorial on saving recordings during runtime:
I have already watched the tutorial and I already tried to dynamically make the audio files but I ran into the problem of playing a random audio file back. I couldn’t figure out how to randomize it and play it back. That’s why I switched to the current implementation. My problem was I wasn’t able to figure out how to switch the string into a “Sound Base Object Reference”.
If you have a fix for the old one, I will be happy to revert back, considering I didn’t have to change much in the code to get to where I am now.
I figured out how to make it work! It now plays back the audio that I record! What I did was export the file type as a sound wave, and then added the return value to a list, and just got a random item from the list and played that back. The list was of type “Sound Wave Object Reference”.