Modified AudioService to check endianness; fixes Xbox 360 audio.
This commit is contained in:
parent
c3b65587f3
commit
18fa25759d
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.GamerServices;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Microsoft.Xna.Framework.Input;
|
||||
|
||||
|
@ -20,8 +21,9 @@ namespace Jellyfish.Library
|
|||
Content.RootDirectory = "Content";
|
||||
GraphicsDeviceManager = new GraphicsDeviceManager(this);
|
||||
#if WINDOWS_PHONE
|
||||
GraphicsDeviceManager.IsFullScreen = true;
|
||||
TargetElapsedTime = TimeSpan.FromTicks(333333); // 30 fps
|
||||
#elif XBOX
|
||||
Components.Add(new GamerServicesComponent(this));
|
||||
#endif
|
||||
GraphicsDeviceService = (IGraphicsDeviceService)Services.GetService(typeof(IGraphicsDeviceService));
|
||||
|
||||
|
|
|
@ -14,8 +14,16 @@ namespace Jellyfish.Virtu.Services
|
|||
|
||||
public void Output(int data) // machine thread
|
||||
{
|
||||
_buffer[_index + 0] = (byte)(data & 0xFF);
|
||||
_buffer[_index + 1] = (byte)(data >> 8);
|
||||
if (BitConverter.IsLittleEndian)
|
||||
{
|
||||
_buffer[_index + 0] = (byte)(data & 0xFF);
|
||||
_buffer[_index + 1] = (byte)(data >> 8);
|
||||
}
|
||||
else
|
||||
{
|
||||
_buffer[_index + 0] = (byte)(data >> 8);
|
||||
_buffer[_index + 1] = (byte)(data & 0xFF);
|
||||
}
|
||||
_index = (_index + 2) % SampleSize;
|
||||
if (_index == 0)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue