Skip to content

fuziki/WorldInApple

Repository files navigation

WorldInApple

Platform Swift Xode

Swift wrapper for vocoder World (https://github.com/mmorise/World)

Features

  • Support Platform
    • iOS (iOS11 or later)
    • macOS (Catalina or later)
  • Property
    • Shift Pitch
    • Shift Formant

Required

  • Xcode 14.X

Projects

WorldInApple

WorldInApple Target

  • swift wrapper for World

WorldLib

  • World library source code
  • fix header path
    • Because SwiftPM does not support USER_HEADER_SEARCH_PATHS
    • refer to the patch file for details. (fix-world-header-path.patch)

Examples

Multiplatform (iOS)

  • Example for iOS
clone https://github.com/fuziki/WorldInApple
cd WorldInApple
open WorldInApple.xcworkspace

Usage

Shift AVAudioPCMBuffer pitch and formant

let buffer: AVAudioPCMBuffer
x_length = buffer.frameLength  

make WorldInApple instance

let worldInApple = WorldInApple(fs: 48000, frame_period: 5, x_length: 38400)

set pitch and formant

worldInApple.set(pitch: Double(1.2))    //positive number
worldInApple.set(formant: Double(1.8))    //positive number

shift pitch and formant

let result = worldInApple.conv(buffer: buffer)

Installation

SwiftPM

https://github.com/fuziki/WorldInApple
    dependencies: [
        // Dependencies declare other packages that this package depends on.
        // .package(url: /* package url */, from: "1.0.0"),
        .package(url: "https://github.com/fuziki/WorldInApple", from: "0.1.0"),
    ],

Makefile

  • install-worldlib

    • download World
    • copy files
    • apply patch file
  • clean-worldlib

    • clean world