Skip to content

Cannot find 'SesameSession' in scope #245

@hongbo-miao

Description

@hongbo-miao

I am trying to use mlx-audio 0.2.5 and build on iPhone 13 Pro Max with iOS 26.0.1.

Experiment 1

Here is a minimum reproducable code: https://github.com/hongbo-miao/hongbomiao.com/pull/34934/files

import Foundation
import Swift_TTS

func speakJokeText(jokeText: String) async throws {
  let trimmedJokeText = jokeText.trimmingCharacters(in: .whitespacesAndNewlines)
  guard !trimmedJokeText.isEmpty else {
    return
  }

  let sesameSession = try await SesameSession(voice: .conversationalA)
  _ = try await sesameSession.generate(for: trimmedJokeText)
}

failed to build and gives me error

Cannot find 'SesameSession' in scope

How can I use SesameSession correctly? Thanks! 😃

Image

Experiment 2

Since SesameSession does not exist in experiment 1, I tried another way basically using the model directly. And this succeed building.

import Foundation
import Swift_TTS

func speakJokeText(jokeText: String) {
  let trimmedJokeText = jokeText.trimmingCharacters(in: .whitespacesAndNewlines)
  guard !trimmedJokeText.isEmpty else {
    return
  }

  let kokoroTTSModel = KokoroTTSModel()
  kokoroTTSModel.say(trimmedJokeText, .afSarah)
}

However when using, I got below error. I guess because of the model not auto download?

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions