Skip to content

Commit eec12c6

Browse files
committed
Initial commit.
0 parents  commit eec12c6

7 files changed

Lines changed: 70 additions & 0 deletions

File tree

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
obj/
2+
/packages/
3+
riderModule.iml
4+
/_ReSharper.Caches/

Program.cs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
using SoundFlow.Backends.MiniAudio;
2+
using SoundFlow.Components;
3+
using SoundFlow.Providers;
4+
using SoundFlow.Enums;
5+
6+
7+
// Initialize the audio engine with the MiniAudio backend
8+
using var audioEngine = new MiniAudioEngine(44100, Capability.Playback);
9+
10+
// Create a SoundPlayer and load an audio file
11+
var player = new SoundPlayer(new StreamDataProvider(File.OpenRead("test_audio.mp3")));
12+
13+
// Add the player to the master mixer
14+
Mixer.Master.AddComponent(player);
15+
16+
// Start playback
17+
player.Play();
18+
19+
// Keep the console application running until playback finishes
20+
Console.WriteLine("Playing audio... Press any key to stop.");
21+
Console.ReadKey();
22+
23+
// Stop playback and remove the player from the mixer
24+
player.Stop();
25+
Mixer.Master.RemoveComponent(player);

SoundFlow-Console-Demo.csproj

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net8.0</TargetFramework>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
<RootNamespace>ConsoleApp2</RootNamespace>
9+
</PropertyGroup>
10+
11+
<ItemGroup>
12+
<PackageReference Include="SoundFlow" Version="1.0.2" />
13+
</ItemGroup>
14+
15+
</Project>

SoundFlow-Console-Demo.sln

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SoundFlow-Console-Demo", "SoundFlow-Console-Demo.csproj", "{AE971600-D662-4B5B-84A6-A76AE06ABF41}"
4+
EndProject
5+
Global
6+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
7+
Debug|Any CPU = Debug|Any CPU
8+
Release|Any CPU = Release|Any CPU
9+
EndGlobalSection
10+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
11+
{AE971600-D662-4B5B-84A6-A76AE06ABF41}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
12+
{AE971600-D662-4B5B-84A6-A76AE06ABF41}.Debug|Any CPU.Build.0 = Debug|Any CPU
13+
{AE971600-D662-4B5B-84A6-A76AE06ABF41}.Release|Any CPU.ActiveCfg = Release|Any CPU
14+
{AE971600-D662-4B5B-84A6-A76AE06ABF41}.Release|Any CPU.Build.0 = Release|Any CPU
15+
EndGlobalSection
16+
EndGlobal

bin/Debug/net8.0/run.bat

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
REM Run using CMD to observe any exceptions.
2+
SoundFlow-Console-Demo.exe
3+
pause

bin/Debug/net8.0/test_audio.mp3

2.47 MB
Binary file not shown.

global.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"sdk": {
3+
"version": "8.0.0",
4+
"rollForward": "latestMinor",
5+
"allowPrerelease": false
6+
}
7+
}

0 commit comments

Comments
 (0)