diff --git a/Sources/TextToSpeechV1/TextToSpeech.swift b/Sources/TextToSpeechV1/TextToSpeech.swift index e64858267..bd5d35274 100644 --- a/Sources/TextToSpeechV1/TextToSpeech.swift +++ b/Sources/TextToSpeechV1/TextToSpeech.swift @@ -1342,7 +1342,6 @@ public class TextToSpeech { * The prompt audio must be in WAV format and must have a minimum sampling rate of 16 kHz. The service accepts audio with higher sampling rates. The service transcodes all audio to 16 kHz before processing it. * The length of the prompt audio is limited to 30 seconds. - - parameter filename: The filename for file. - parameter headers: A dictionary of request headers to be sent with this request. - parameter completionHandler: A function executed when the request completes with a successful result or error */ @@ -1351,7 +1350,6 @@ public class TextToSpeech { promptID: String, metadata: PromptMetadata, file: Data, - filename: String, headers: [String: String]? = nil, completionHandler: @escaping (WatsonResponse?, WatsonError?) -> Void) { @@ -1363,7 +1361,7 @@ public class TextToSpeech { } multipartFormData.append(metadataJSON, withName: "metadata", mimeType: "application/json") - multipartFormData.append(file, withName: "file", mimeType: "audio/wav", fileName: filename) + multipartFormData.append(file, withName: "file", mimeType: "audio/wav", fileName: "filename") guard let body = try? multipartFormData.toData() else { completionHandler(nil, RestError.serialization(values: "request multipart form data")) return diff --git a/Tests/TextToSpeechV1Tests/TextToSpeechTests.swift b/Tests/TextToSpeechV1Tests/TextToSpeechTests.swift index 7b9e41b0e..a3a06418c 100644 --- a/Tests/TextToSpeechV1Tests/TextToSpeechTests.swift +++ b/Tests/TextToSpeechV1Tests/TextToSpeechTests.swift @@ -678,8 +678,7 @@ class TextToSpeechTests: XCTestCase { let promptMetadata = PromptMetadata(promptText: "Hello, how are you today?") let file = Bundle(for: type(of: self)).url(forResource: "custom_prompt_audio", withExtension: "wav")! let fileData = try! Data(contentsOf: file) - let filename = "custom_prompt_audio.wav" - textToSpeech.addCustomPrompt(customizationID: customizationID, promptID: promptID, metadata: promptMetadata, file: fileData, filename: filename) { + textToSpeech.addCustomPrompt(customizationID: customizationID, promptID: promptID, metadata: promptMetadata, file: fileData) { response, error in if let error = error { if !error.localizedDescription.contains(self.litePlanMessage) {