Open hessaum opened 6 years ago
when you create a property inside of a function, that property only exists within that function. To use a property in another function or elsewhere in the code, you must set that property as a global property; like you did towards the top of your code with audioPlayer AudioRecorder. Once you do that, you can just alter these properties within your function playerSetup before running soundPlayer.play() down at the bottom when the play button is pressed.
Also make sure to add your Privacy description in the info.plist for the microphone usage otherwise the app will crash immediately for trying to access the mic without user permission.
Hope this helps.
Im not sure why I am receiving this identifier error in the function call.
` func playerSetup() { let audioFileName = getDocumentsDirector().appendingPathComponent(fileName)
`