Skip to content

Marvis-Labs/marvis-tts-swift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Marvis TTS (Swift)

A Swift version of Marvis TTS, running locally on Apple Silicon using MLX Swift.

  • Streaming generation for realtime playback
  • Expressive voice presets
  • On-device inference
  • Simple API

Requirements

  • macOS 14+
  • Xcode 15+ / Swift 5.10+

Installation

Xcode

In Xcode you can add https://github.com/Marvis-Labs/marvis-tts-swift.git as a package dependency.

SwiftPM

To use marvis-tts-swift with SwiftPM you can add this to your Package.swift:

dependencies: [
    .package(url: "https://github.com/Marvis-Labs/marvis-tts-swift", from: "0.1")
]

and add the libraries as dependencies:

dependencies: [.product(name: "MarvisTTS", package: "marvis-tts-swift")]

Note

SwiftPM (command line) cannot build the Metal shaders in MLX Swift, so Xcode is required to build.

Quick Start

import MarvisTTS

let model = try await MarvisTTS.fromPretrained { progress in /* optionally show download progress */ }
let player = LocalAudioPlayer(sampleRate: model.sampleRate)

// Stream audio for playback as it's generated.
let text = "With Marvis TTS, you can stream audio generated directly on device, fully locally and privately."

for try await result in model.generate(text: text) {
    player.enqueue(samples: $0.audio)
}

player.stop(waitForEnd: true)

Note

Using a release build or enabling optimizations will signficantly increase generation performance.

More Info

Technical Limitations

  • Language Support: English, French, and German

Legal and Ethical Considerations

  • Users are responsible for complying with local laws regarding voice synthesis and impersonation
  • Consider intellectual property rights when cloning voices of public figures
  • Respect privacy laws and regulations in your jurisdiction
  • Obtain appropriate consent and permissions before deployment

License & Agreement

  • Apache 2.0

About

A Swift version of Marvis TTS, running locally on Apple Silicon using MLX Swift.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages