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.
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.
- Aurio.dll
- Aurio.Exocortex.dll
- Aurio.FFmpeg.dll
- Aurio.FFTW.dll
- Aurio.LibSampleRate.dll
- Aurio.Matching.SQLite.dll
- Aurio.PFFFT.dll
- Aurio.Soxr.dll
- Aurio.WaveControls.dll
- Exocortex.DSP.v1.dll
- netstandard.dll
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
Post a Comment