Skip to content

About

XYZWaveAndVoice is a library for voice recognition and voiceprint analysis. It enables speaker identification, speech-to-text conversion, and voiceprint-based security in iOS apps. The library simplifies voice processing integration, providing a seamless user experience for voice-enabled applications.

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Repository files navigation

XYZWaveAndVoice

中文 · Privacy · Changes

A lightweight UIKit waveform with cyan–violet gradients, layered glow, translucent ribbons and smooth audio response. The demo combines the view with Apple's Speech framework for live transcription.

Illustrative static preview of the voice studio interface

Illustrative static preview, not a device screenshot. Sample text is synthetic.

Features

  • Configurable gradient colors, glow, wave count and line widths.
  • Fast attack / gentle release smoothing and bounded rendering work.
  • Responsive dark demo with start/stop controls and a live transcript.
  • A single microphone input feeds recognition and waveform levels.
  • Permission requests only after tapping Start; recording stops when leaving the screen.
  • Reduced-motion support in the demo.

The library target exports XYZWaveformView only. Speech recognition is demonstrated in XYZWaveAndVoice/VoiceInputViewController.swift. Speaker identification and biometric authentication are not implemented.

Requirements

  • iOS 15 or later.
  • Swift Package tools 5.5 or later; an Xcode version compatible with your device's iOS.

Installation

Swift Package Manager

Add https://github.com/brandy2015/XYZWaveAndVoice.git in Xcode's package dependencies. Select main to try the unreleased visual update.

CocoaPods

pod 'XYZWaveAndVoice'

The published Pod version may predate the changes on main. To try the current source:

pod 'XYZWaveAndVoice', :git => 'https://github.com/brandy2015/XYZWaveAndVoice.git', :branch => 'main'

Usage

import XYZWaveAndVoice

let waveform = XYZWaveformView()
waveform.backgroundColor = .clear
waveform.waveColor = .systemCyan
waveform.secondaryColor = .systemPurple
waveform.glowIntensity = 0.65
waveform.numberOfWaves = 5

// Supply normalized microphone levels on the main thread each display frame.
waveform.updateWithLevel(0.25)
waveform.phaseShift = UIAccessibility.isReduceMotionEnabled ? 0 : -0.055

The view does not schedule its own animation. Drive it with a display link or your audio UI update loop. Zero/negative wave counts and invalid sampling densities skip drawing; nonfinite audio levels are treated as silence. Rendering is capped at 24 layers and 1,024 samples per layer.

Run the demo on an iPhone

  1. Open XYZWaveAndVoice.xcodeproj. The demo does not require CocoaPods installation.
  2. Select the app target, then choose your own Team under Signing & Capabilities. Personal signing information is intentionally absent from the shared project.
  3. Connect and unlock your iPhone; complete the system's trust/developer setup if prompted.
  4. Select the iPhone as the run destination and press Run.
  5. Tap Start listening and grant microphone and speech permissions. The sample recognizer uses en_US; change its locale in the controller for another language.

The included Info.plist supplies NSMicrophoneUsageDescription and NSSpeechRecognitionUsageDescription. Apps integrating the speech example must supply their own descriptions. Speech recognition may use Apple's servers; see Privacy.

Validation

Unsigned device build:

xcodebuild -project XYZWaveAndVoice.xcodeproj -scheme XYZWaveAndVoice \
  -destination 'generic/platform=iOS' CODE_SIGNING_ALLOWED=NO build

Open Package.swift in Xcode to run package tests on an installed iOS simulator. Regression tests cover valid amplitudes, invalid levels, invalid drawing settings and extreme styling values. Compilation checks do not replace a real microphone/device test.

License

MIT. See LICENSE.

About

XYZWaveAndVoice is a library for voice recognition and voiceprint analysis. It enables speaker identification, speech-to-text conversion, and voiceprint-based security in iOS apps. The library simplifies voice processing integration, providing a seamless user experience for voice-enabled applications.

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages