Share:

Create Multitracks Media Player Using Aurio Library - Amit Padhiyar (Saatody)

Step 01: Open the Visual Studio and create a C# project in console application.
Step 02: Set the name of project which is MultiTracks
Step 03: Add the follow libraries (.dlls) from Aurio folder as a previous post. First right click on references and add references.
  1. Aurio.dll
  2. Aurio.Exocortex.dll
  3. Aurio.FFmpeg.dll
  4. Aurio.FFTW.dll
  5. Aurio.LibSampleRate.dll
  6. Aurio.Matching.SQLite.dll
  7. Aurio.PFFFT.dll
  8. Aurio.Soxr.dll
  9. Aurio.WaveControls.dll
  10. Exocortex.DSP.v1.dll
  11. netstandard.dll
Step 04: Compile and run below code in Visual Studio.

using System;
using Aurio;
using Aurio.FFmpeg;
using Aurio.Project;
using Aurio.FFT;
using Aurio.Resampler;
using System.IO;

namespace MultiTracks
{
    public class Program
    {
        public static void Main(string[] args)
        {

            FFTFactory.Factory = new Aurio.PFFFT.FFTFactory();
            ResamplerFactory.Factory = new Aurio.Soxr.ResamplerFactory();
            AudioStreamFactory.AddFactory(new FFmpegAudioStreamFactory());
            
            var Music = new TrackList<AudioTrack>(new[] {
                new AudioTrack(new FileInfo("C:/Users/Amit Padhiyar/Music/t1.wav")),
                new AudioTrack(new FileInfo("C:/Users/Amit Padhiyar/Music/t1.wav")),
                new AudioTrack(new FileInfo("C:/Users/Amit Padhiyar/Music/t1.wav")),
                new AudioTrack(new FileInfo("C:/Users/Amit Padhiyar/Music/t1.wav")),
                new AudioTrack(new FileInfo("C:/Users/Amit Padhiyar/Music/t2.wav")),
                new AudioTrack(new FileInfo("C:/Users/Amit Padhiyar/Music/t2.wav")),
                new AudioTrack(new FileInfo("C:/Users/Amit Padhiyar/Music/t2.wav")),
                new AudioTrack(new FileInfo("C:/Users/Amit Padhiyar/Music/t2.wav")),
                new AudioTrack(new FileInfo("C:/Users/Amit Padhiyar/Music/t3.wav")),
                new AudioTrack(new FileInfo("C:/Users/Amit Padhiyar/Music/t3.wav")),
                new AudioTrack(new FileInfo("C:/Users/Amit Padhiyar/Music/t3.wav"))
            });

            Music[0].Offset = new TimeSpan(0, 0, 1);
            Music[1].Offset = new TimeSpan(0, 0, 2);
            Music[2].Offset = new TimeSpan(0, 0, 3);
            Music[3].Offset = new TimeSpan(0, 0, 4);
            Music[4].Offset = new TimeSpan(0, 0, 1);
            Music[5].Offset = new TimeSpan(0, 0, 2);
            Music[6].Offset = new TimeSpan(0, 0, 3);
            Music[7].Offset = new TimeSpan(0, 0, 4);
            Music[8].Offset = new TimeSpan(0, 0, 0);
            Music[9].Offset = new TimeSpan(0, 0, 2);
            Music[10].Offset = new TimeSpan(0, 0, 4);
            
            MultitrackPlayer Player = new MultitrackPlayer(Music);
            if(Player.CanPlay == true)
            {
                Player.Play();
            }
            Player.CurrentTimeChanged += Player_CurrentTimeChanged;
       
        }

        private static void Player_CurrentTimeChanged(object sender, ValueEventArgs<TimeSpan> e)
        {
            var Player = sender as MultitrackPlayer;
            Console.WriteLine("Player: " + Player.CurrentTime);
        }
    }
}



Comments

Popular posts from this blog

Get Color From Pixel C# WPF | Saatody | Amit Padhiyar

Basic Audio Operations With MP3 And Wave Files Using NAudio C#

Create Drag And Drop Operation Between DevExpress GridControl And Custom WPF UI | Saatody | Amit Padhiyar