Skip to content

Audio Editor Kit Codelab. Example to separate audio sources from audio file.

Notifications You must be signed in to change notification settings

Explore-In-HMS/SeparateAudioCodelab

Repository files navigation

Separate & Compose Audios

Kotlin Minimum SDK Version Android Gradle Version Gradle Version

In this project you can extract the audio from the video, split the music into its components and combine these components to create new audio files. You can extract following instruments from music:

  1. Vocals
  2. Music
  3. Drums
  4. Guitar
  5. Bass Guitar
  6. Violin
  7. Piano

Introduction

Features:

  1. Extract audio from video.
  2. Separate instruments from audio file.
  3. Compose separated instruments and create new audio file.

About HUAWEI Audio Editor Kit

Audio Editor Kit provides a wide range of audio editing capabilities, including AI dubbing, audio source separation, spatial audio, voice changer, and sound effects.

For more information -> Huawei Audio Editor Kit Guide

What You Will Need

Hardware Requirements

  • A computer that can run Android Studio.
  • Huawei mobile device with a USB data cable for running developed apps

Software Requirements

  • Java JDK 1.8 or later
  • Android Studio 2021.2.x
  • Android SDK package
  • Android API Level 21 or higher
  • HMS Core (APK) 5.0.0.300 or later
  • EMUI 8.0 or later

Getting Started

This project uses HUAWEI services. To use them, you have to create an app first. Before getting started, please sign-up for a HUAWEI developer account.

After creating the application, you need to generate a signing certificate fingerprint. Then you have to set this fingerprint to the application you created in AppGallery Connect.

  • Go to "My Projects" in AppGallery Connect.
  • Find your project from the project list and click the app on the project card.
  • On the Project Setting page, set SHA-256 certificate fingerprint to the SHA-256 fingerprint you've generated. AGC-Fingerprint

Using the Application

Upon completing the essential parts of the code, connect your mobile device to the PC and enable the USB debugging mode. In the Android Studio window, click the icon to run the project you have created in Android Studio to generate an APK. Then install the APK on the mobile device.

  1. Before you run the app, make sure that you have a working internet connection.
  2. Then, open the app upon installing it on your device.
  3. On first page you will see two buttons direct you to audio extraction and sound separation pages.
  4. When you click extract audio you will se extraction page. In this page you can choose videos from your phone and its after extraction name.
  5. After extraction you will see a pop-up screen asks you want to use extracted audio to in separation page. You can use audio file you extracted from video or you can use another audio from your device.
  6. After you reach the separation page you will see list of instruments. You can choose which one of thoose instruments you want to separate from audio file. You can select more than one and you can select all. Also you can change destination folder to save separated audio files. Separation progress can take several minutes.
  7. When separation is done you will be taken to composing page. In this page you will see instruments in a list you chosed on previous page.
  8. You can click sound icons to listen separated instruments.
  9. In this page you can select insturments to compose them and you can specify file name after composition.
  10. New audio file will be created with selected instruments when you clicked to compose button.

Screenshots

Project Structure

This project is designed with MVVM design pattern.

Libraries

  • Huawei Audio Editor Kit
  • Kotlin Coroutines
  • Navigation
  • Sonarqube

License

 Copyright 2022. Explore in HMS. All rights reserved.

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.

About

Audio Editor Kit Codelab. Example to separate audio sources from audio file.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages