Post

Replies

Boosts

Views

Activity

Reply to save audio file in iOS 18 instead of iOS 12
Here is the main method I use: func synthesize(utteranceString: String, avAudioPCMBufferFormatSettings: [String:Any], usingVoiceIdentifier voiceIdentifier: String, utteranceRate: Float, pitchMultiplier: Float, andSaveAudioFileTo saveToURL: URL, completionHandler: ((_ pcmBuffer: AVAudioPCMBuffer, _ audioFile: AVAudioFile?)->Void)? = nil) { print("#", #function, "voiceIdentifier: \(voiceIdentifier)", terminator: "\n") let utterance = AVSpeechUtterance(string: utteranceString) utterance.rate = utteranceRate utterance.pitchMultiplier = pitchMultiplier let voice = AVSpeechSynthesisVoice(identifier: voiceIdentifier) // TODO: Why is this generating a nil? utterance.voice = voice synthesizer.write(utterance) { (buffer: AVAudioBuffer) in print("in closure") // TODO: Tailor code in this closure to adjust to current device running this app project. guard let pcmBuffer = buffer as? AVAudioPCMBuffer else { fatalError("unknown buffer unknown buffer type: \(buffer)") } if pcmBuffer.frameLength == 0 { print("done because buffer frame length equals 0") } else { // append buffer to file if self.audioFile == nil { print("self.audioFile == nil") do { self.audioFile = try AVAudioFile( forWriting: saveToURL, settings: pcmBuffer.format.settings, commonFormat: .pcmFormatInt16, interleaved: false) } catch { print("try AVAudioFile( catch error: \(error.localizedDescription)") completionHandler?(pcmBuffer, nil) } } do { try self.audioFile!.write(from: pcmBuffer) print("!!! 2") completionHandler?(pcmBuffer, self.audioFile) } catch { print("try self.audioFile!.write(from: pcmBuffer) catch error: \(error.localizedDescription)") completionHandler?(pcmBuffer,nil) } } } }
Topic: Media Technologies SubTopic: Audio Tags:
Mar ’25
Reply to How to convert colors from Light Mode to Dark Mode?
I have the same problem. Have you figured this out?
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Apr ’25
Reply to save audio file in iOS 18 instead of iOS 12
I got it to work. I needed to use .pcmFormatFloating32 instead of .pcmIFormatnt16
Topic: Media Technologies SubTopic: Audio Tags:
Replies
Boosts
Views
Activity
Mar ’25
Reply to save audio file in iOS 18 instead of iOS 12
Here is the main method I use: func synthesize(utteranceString: String, avAudioPCMBufferFormatSettings: [String:Any], usingVoiceIdentifier voiceIdentifier: String, utteranceRate: Float, pitchMultiplier: Float, andSaveAudioFileTo saveToURL: URL, completionHandler: ((_ pcmBuffer: AVAudioPCMBuffer, _ audioFile: AVAudioFile?)->Void)? = nil) { print("#", #function, "voiceIdentifier: \(voiceIdentifier)", terminator: "\n") let utterance = AVSpeechUtterance(string: utteranceString) utterance.rate = utteranceRate utterance.pitchMultiplier = pitchMultiplier let voice = AVSpeechSynthesisVoice(identifier: voiceIdentifier) // TODO: Why is this generating a nil? utterance.voice = voice synthesizer.write(utterance) { (buffer: AVAudioBuffer) in print("in closure") // TODO: Tailor code in this closure to adjust to current device running this app project. guard let pcmBuffer = buffer as? AVAudioPCMBuffer else { fatalError("unknown buffer unknown buffer type: \(buffer)") } if pcmBuffer.frameLength == 0 { print("done because buffer frame length equals 0") } else { // append buffer to file if self.audioFile == nil { print("self.audioFile == nil") do { self.audioFile = try AVAudioFile( forWriting: saveToURL, settings: pcmBuffer.format.settings, commonFormat: .pcmFormatInt16, interleaved: false) } catch { print("try AVAudioFile( catch error: \(error.localizedDescription)") completionHandler?(pcmBuffer, nil) } } do { try self.audioFile!.write(from: pcmBuffer) print("!!! 2") completionHandler?(pcmBuffer, self.audioFile) } catch { print("try self.audioFile!.write(from: pcmBuffer) catch error: \(error.localizedDescription)") completionHandler?(pcmBuffer,nil) } } } }
Topic: Media Technologies SubTopic: Audio Tags:
Replies
Boosts
Views
Activity
Mar ’25
Reply to Do I need to down load iOS 18 for testing on iPhone 11 having iOS version 17.6.1 ?
Has anyone gotten this to work without downloading iOS 18?
Replies
Boosts
Views
Activity
Nov ’24
Reply to Unable to List Voice Folder - AVSpeechSynthesizer
Have you figured this out?
Topic: Media Technologies SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jul ’24
Reply to How to make AVSpeechSynthesizer work for write and delegate (Catalina)
Were you able to get AVSpeechSynthesizer to work in IPA mode? I'm trying to figure this one out.
Topic: Machine Learning & AI SubTopic: General Tags:
Replies
Boosts
Views
Activity
May ’24
Reply to SSML sub tag in AVSpeechUtterance
Did you get an answer?
Topic: Machine Learning & AI SubTopic: General Tags:
Replies
Boosts
Views
Activity
Apr ’24
Reply to Xcode Lagging Continuously - Force Quit Doesn't Work!!!
I am able to force quit, but it still lags when I restart Xcode & even restart my Mac Pro.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Mar ’24
Reply to Xcode 15 will not connect to ios17 device via network
iOS 17 emulator? Is that the same as simulator?
Replies
Boosts
Views
Activity
Mar ’24
Reply to How do I request permission from Apple to access the lightning port to customize with my app?
I found it. MFi Program.
Topic: Code Signing SubTopic: Entitlements Tags:
Replies
Boosts
Views
Activity
Dec ’23
Reply to XCode 15 Beta 5 does not show my iPhone as a run destination
Do you have a solution for this now that Xcode 15 has been released?
Replies
Boosts
Views
Activity
Nov ’23
Reply to "PosterBoard quit unexpectedly." warning in my Mac running macOS 13.4.1(c)
I have no idea what PosterBoard is. One of the questions in Apple Forums indicated it had something to do with Simulator as I understand it, but I would think an actual device would also have common software with Simulator. But I still believe I don't know.
Replies
Boosts
Views
Activity
Aug ’23
Reply to CNContactViewController highlightPropertyWithKey produces blank VC
Hi @kontiki, have you figured out how to get the highlightProperty of CNContactViewController to work?
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Aug ’23
Reply to CNContactViewController highlightPropertyWithKey produces blank VC
I have the same problem that the property doesn't get highlighted, except the error message is: "[PPT] Error creating the CFMessagePort needed to communicate with PPT." Is there a current solution or workaround?
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
May ’23
Reply to How to present a UIAlertController from controller in main window and make it appear above a controller in an overlaid UIWindow
Would this work if use it from my Share Controller to tell the user that the act of sharing occurred or succeeded when the user uses my share extension by telling an app to share with my app?
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
May ’23