mediapipe/mediapipe/tasks/web/audio
Sebastian Schmidt 1c9e6894f3 Allow users to pass canvas element
PiperOrigin-RevId: 518870611
2023-03-23 08:46:21 -07:00
..
audio_classifier Allow users to pass canvas element 2023-03-23 08:46:21 -07:00
audio_embedder Allow users to pass canvas element 2023-03-23 08:46:21 -07:00
core Allow users to pass canvas element 2023-03-23 08:46:21 -07:00
BUILD Internal change 2023-01-17 20:53:34 -08:00
index.ts Fix comments 2023-01-19 10:08:44 -08:00
README.md Create README.md files to NPM packages 2023-01-09 10:36:49 -08:00
types.ts Internal change 2023-01-17 20:53:34 -08:00

MediaPipe Tasks Vision Package

This package contains the audio tasks for MediaPipe.

Audio Classification

The MediaPipe Audio Classification task performs classification on audio data.

const audio = await FilesetResolver.forAudioTasks(
    "https://cdn.jsdelivr.net/npm/@mediapipe/tasks-audio@latest/wasm"
);
const audioClassifier = await AudioClassifier.createFromModelPath(audio,
    "https://storage.googleapis.com/mediapipe-tasks/audio_classifier/yamnet_audio_classifier_with_metadata.tflite"
);
const classifications = audioClassifier.classifiy(audioData);

Audio Embedding

The MediaPipe Audio Embedding task extracts embeddings from audio data.

const audio = await FilesetResolver.forAudioTasks(
    "https://cdn.jsdelivr.net/npm/@mediapipe/tasks-audio@latest/wasm"
);
const audioEmbedder = await AudioEmbedder.createFromModelPath(audio,
    "model.tflite"
);
const embeddings = audioEmbedder.embed(audioData);