Skip to content

Commit dd2a0b2

Browse files
committed
fix: hardcode input sample rate to 16,000
1 parent ebe9b17 commit dd2a0b2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Sources/ElevenLabsSwift/ElevenLabsSwift.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ public class ElevenLabsSDK {
1010
private enum Constants {
1111
static let defaultApiOrigin = "wss://api.elevenlabs.io"
1212
static let defaultApiPathname = "/v1/convai/conversation?agent_id="
13+
static let inputSampleRate: Double = 16000
1314
static let sampleRate: Double = 16000
1415
static let ioBufferDuration: Double = 0.005
1516
static let volumeUpdateInterval: TimeInterval = 0.1
@@ -581,7 +582,7 @@ public class ElevenLabsSDK {
581582
let connection = try await Connection.create(config: config)
582583

583584
// Step 3: Create the audio input
584-
let input = try await Input.create(sampleRate: Double(connection.sampleRate))
585+
let input = try await Input.create(sampleRate: Constants.inputSampleRate)
585586

586587
// Step 4: Create the audio output
587588
let output = try await Output.create(sampleRate: Double(connection.sampleRate))

0 commit comments

Comments
 (0)