testing sound

main
cosmonaut 2021-01-19 21:33:32 -08:00
parent b6f8bd8c97
commit 0c97df6e25
5 changed files with 23 additions and 1 deletions

BIN
Content/title_screen.ogg Normal file

Binary file not shown.

View File

@ -0,0 +1,8 @@
{
"profiles": {
"MoonWorksTest": {
"commandName": "Project",
"nativeDebugging": true
}
}
}

@ -1 +1 @@
Subproject commit 408e438efcf8a19992c3b0ecd74bfd11b65441e6 Subproject commit ec28d17a755e267bafd4354d615c3f6ddb1f0cc2

View File

@ -8,6 +8,7 @@ namespace MoonWorksTest
{ {
WindowCreateInfo windowCreateInfo = new WindowCreateInfo WindowCreateInfo windowCreateInfo = new WindowCreateInfo
{ {
WindowTitle = "MoonWorksTest",
WindowWidth = 1280, WindowWidth = 1280,
WindowHeight = 720, WindowHeight = 720,
ScreenMode = ScreenMode.Windowed ScreenMode = ScreenMode.Windowed

View File

@ -1,6 +1,8 @@
using MoonWorks; using MoonWorks;
using MoonWorks.Audio;
using MoonWorks.Graphics; using MoonWorks.Graphics;
using RefreshCS; using RefreshCS;
using System.IO;
using System.Threading; using System.Threading;
namespace MoonWorksTest namespace MoonWorksTest
@ -34,6 +36,9 @@ namespace MoonWorksTest
uint screenShotBufferSize; uint screenShotBufferSize;
Thread screenshotThread; Thread screenshotThread;
StaticSound music;
StaticSoundInstance musicInstance;
public TestGame(WindowCreateInfo windowCreateInfo, PresentMode presentMode, int targetTimestep = 60, bool debugMode = false) : base(windowCreateInfo, presentMode, targetTimestep, debugMode) public TestGame(WindowCreateInfo windowCreateInfo, PresentMode presentMode, int targetTimestep = 60, bool debugMode = false) : base(windowCreateInfo, presentMode, targetTimestep, debugMode)
{ {
var windowWidth = windowCreateInfo.WindowWidth; var windowWidth = windowCreateInfo.WindowWidth;
@ -249,6 +254,14 @@ namespace MoonWorksTest
screenshotPixels = new byte[screenShotBufferSize]; screenshotPixels = new byte[screenShotBufferSize];
screenshotBuffer = new Buffer(GraphicsDevice, 0, screenShotBufferSize); screenshotBuffer = new Buffer(GraphicsDevice, 0, screenShotBufferSize);
screenshotThread = new Thread(new ThreadStart(SaveScreenshot)); screenshotThread = new Thread(new ThreadStart(SaveScreenshot));
music = StaticSound.LoadOgg(AudioDevice, new FileInfo(Path.Combine("Content", "title_screen.ogg")));
musicInstance = music.CreateInstance();
musicInstance.Play();
//music = new DynamicSound(AudioDevice, new FileInfo(Path.Combine("Content", "title_screen.ogg")));
//musicInstance = music.CreateInstance();
//musicInstance.Play();
} }
protected override void Update(double dt) protected override void Update(double dt)