File size: 1,308 Bytes
5601b89
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
---
license: apache-2.0
base_model: neuphonic/neucodec
tags:
  - coreml
  - audio
  - speech
  - codec
  - ios
  - mlpackage
---

# neucodec-coreml-decoder

CoreML (.mlpackage) conversion of [NeuCodec](https://huggingface.co/neuphonic/neucodec) decoder by Neuphonic.

Converts flat FSQ codes to 24kHz audio. Supports iOS 16+ / macOS 13+.

## Files

| File | Tokens | Duration |
|------|--------|----------|
| `neucodec_decoder_seq50.mlpackage` | 50 | 1s |
| `neucodec_decoder_seq100.mlpackage` | 100 | 2s |
| `neucodec_decoder_seq250.mlpackage` | 250 | 5s |

## I/O

- **Input** `codes`: shape `(1, 1, L)` Int32, flat FSQ indices 0-65535 at 50 tok/sec
- **Output** `audio`: shape `(1, 1, T)` Float32 at 24kHz

## Swift Usage

```swift
import CoreML

let config = MLModelConfiguration()
config.computeUnits = .cpuAndGPU
let model = try MLModel(contentsOf: compiledURL, configuration: config)

let codesArray = try MLMultiArray(shape: [1, 1, 100], dataType: .int32)
for i in 0..<100 { codesArray[i] = NSNumber(value: flatCode) }
let input = try MLDictionaryFeatureProvider(dictionary: ["codes": codesArray])
let output = try await model.prediction(from: input)
// output["audio"]: shape [1, 1, T], Float32 at 24kHz
```

## Source

[neuphonic/neucodec](https://huggingface.co/neuphonic/neucodec) — Apache 2.0