Skip to content

Commit

Permalink
Updating media rate hertz
Browse files Browse the repository at this point in the history
  • Loading branch information
ruisebas committed Dec 23, 2024
1 parent 13b1ca2 commit b00bb62
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions AWSTranscribeStreamingTests/AWSTranscribeStreamingSwiftTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,34 @@ class AWSTranscribeStreamingSwiftTests: XCTestCase {
}

func testStreamingExampleEnglish() throws {
try transcribeAudio(languageCode: .enUS, fileName: "hello_world")
try transcribeAudio(
languageCode: .enUS,
fileName: "hello_world",
mediaSampleRateHertz: 8000
)
}

func testStreamingExampleDeutsche() throws {
try transcribeAudio(languageCode: .deDE, fileName: "guten_tag")
try transcribeAudio(
languageCode: .deDE,
fileName: "guten_tag",
mediaSampleRateHertz: 24000
)
}

func testStreamingExampleEspañol() throws {
try transcribeAudio(languageCode: .esES, fileName: "hola_mundo")
try transcribeAudio(
languageCode: .esES,
fileName: "hola_mundo",
mediaSampleRateHertz: 24000
)
}

private func transcribeAudio(languageCode: AWSTranscribeStreamingLanguageCode, fileName: String) throws {
private func transcribeAudio(
languageCode: AWSTranscribeStreamingLanguageCode,
fileName: String,
mediaSampleRateHertz: NSNumber
) throws {
let bundle = Bundle(for: AWSTranscribeStreamingSwiftTests.self)
guard let audioPath = bundle.path(forResource: fileName, ofType: "wav") else {
XCTFail("Can't find audio path: \(fileName).wav")
Expand All @@ -72,7 +88,7 @@ class AWSTranscribeStreamingSwiftTests: XCTestCase {

request.languageCode = languageCode
request.mediaEncoding = .pcm
request.mediaSampleRateHertz = 24000
request.mediaSampleRateHertz = mediaSampleRateHertz

// Set up delegate and its expectations
let delegate = MockTranscribeStreamingClientDelegate()
Expand Down

0 comments on commit b00bb62

Please sign in to comment.