Skip to content

Commit

Permalink
Merge branch 'main' into feature/graphics2d
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonDarksideJ authored Aug 10, 2024
2 parents 4ad65e6 + 1755c52 commit f90af13
Show file tree
Hide file tree
Showing 21 changed files with 314 additions and 412 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ But you can use your own if you wish.

Demonstrates how to load a wav file through a file stream.

* [Creating and Playing Sounds](../../whatis/WhatIs_Audio.md)
* [Creating and Playing Sounds](../../whatis/audio/index.md)

Provides overviews about audio technology, and presents predefined scenarios to demonstrate how to use audio.

Expand Down
2 changes: 1 addition & 1 deletion articles/getting_to_know/howto/audio/HowTo_Microphone.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Also, you can use the **BufferReady** event handler of the [Microphone](xref:Mic

## See Also

* [Creating and Playing Sounds](../../whatis/WhatIs_Audio.md)
* [Creating and Playing Sounds](../../whatis/audio/index.md)

Provides overviews about audio technology, and presents predefined scenarios to demonstrate how to use audio.

Expand Down
2 changes: 1 addition & 1 deletion articles/getting_to_know/howto/audio/HowTo_PlayASong.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ The following demonstrates how to play a song from the media file in the content

## See Also

* [Media Overview](../../whatis/WhatIs_Audio.md)
* [Media Overview](../../whatis/audio/index.md)

Provides a high-level overview about the capabilitiessuch as playing music and video and accessing picturesof the Media API in MonoGame.

Expand Down
18 changes: 0 additions & 18 deletions articles/getting_to_know/howto/audio/toc.yml

This file was deleted.

2 changes: 0 additions & 2 deletions articles/getting_to_know/howto/content_pipeline/toc.yml

This file was deleted.

2 changes: 0 additions & 2 deletions articles/getting_to_know/howto/graphics/toc.yml

This file was deleted.

2 changes: 0 additions & 2 deletions articles/getting_to_know/howto/input/toc.yml

This file was deleted.

12 changes: 0 additions & 12 deletions articles/getting_to_know/howto/toc.yml

This file was deleted.

30 changes: 0 additions & 30 deletions articles/getting_to_know/toc.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,68 +1,68 @@
---
title: Sounds Overview
description: An overview of how the MonoGame Framework provides audio playback through several core audio classes.
requireMSLicense: true
---

If your game is to use a few sound files, then the [SoundEffect](xref:Microsoft.Xna.Framework.Audio.SoundEffect), [SoundEffectInstance](xref:Microsoft.Xna.Framework.Audio.SoundEffectInstance), and [DynamicSoundEffectInstance](xref:Microsoft.Xna.Framework.Audio.DynamicSoundEffectInstance) classes will provide everything you need to play and stream audio during gameplay.

## Simple Audio Playback

The simplest way to play sounds for background music or sound effects is to use [SoundEffect](xref:Microsoft.Xna.Framework.Audio.SoundEffect) and [SoundEffectInstance](xref:Microsoft.Xna.Framework.Audio.SoundEffectInstance). Source audio files are added like any other game asset to the project. For example code, see [Playing a Sound](../howto/audio/HowTo_PlayASound.md), [Looping a Sound](../howto/audio/HowTo_LoopASound.md), and [Adjusting Pitch and Volume](../howto/audio/HowTo_ChangePitchAndVolume.md). For background music, see [Playing a Song](../howto/audio/HowTo_PlayASong.md).

## Accessing the Audio Buffer

Developers can use [DynamicSoundEffectInstance](xref:Microsoft.Xna.Framework.Audio.DynamicSoundEffectInstance) for direct access to an audio buffer. By accessing the audio buffer, developers can manipulate sound, break up large sound files into smaller data chunks, and stream sound. For example code, see [Streaming Data from a WAV File](../howto/audio/HowTo_StreamDataFromWav.md).

## 3D Audio

The [SoundEffect](xref:Microsoft.Xna.Framework.Audio.SoundEffect) class provides the ability to place audio in a 3D space. By creating [AudioEmitter](xref:Microsoft.Xna.Framework.Audio.AudioEmitter) and [AudioListener](xref:Microsoft.Xna.Framework.Audio.AudioListener) objects, the API can position a sound in 3D, and can change the 3D position of a sound during playback. Once you create and initialize [AudioEmitter](xref:Microsoft.Xna.Framework.Audio.AudioEmitter) and [AudioListener](xref:Microsoft.Xna.Framework.Audio.AudioListener), call [SoundEffectInstance.Apply3D](xref:Microsoft.Xna.Framework.Audio.SoundEffectInstance).

## Audio Constraints

When working with multiple platforms using MonoGame, there are a few constraints around audio that you will need to keep in mind and cater for, namely:

* Mobile platforms have a maximum of 32 sounds playing simultaneously.
* Desktop platforms have a maximum of 256 sounds playing simultaneously.
* Consoles and other platforms have their own constraints, please look at the console sdk documentation for more information,

> [!IMPORTANT]
> An [InstancePlayLimitException](xref:Microsoft.Xna.Framework.Audio.InstancePlayLimitException) exception is thrown if this limit is exceeded.
## Audio Buffer Format

The `byte[]` buffer format used as a parameter for the [SoundEffect](xref:Microsoft.Xna.Framework.Audio.SoundEffect) constructor, [Microphone.GetData](xref:Microsoft.Xna.Framework.Audio.Microphone) method, and [DynamicSoundEffectInstance.SubmitBuffer](xref:Microsoft.Xna.Framework.Audio.DynamicSoundEffectInstance) method is PCM wave data. Additionally, the PCM format is interleaved and in little-endian.

The audio format has the following constraints:

* The audio channels can be mono (1) or stereo (2).
* The PCM wave file must have 16-bits per sample.
* The sample rate must be between 8,000 Hz and 48,000 Hz.
* The interleaving for stereo data is left channel to right channel.

## Songs as Background Music

Access to the media library, combined with the ability to use playlists, allows games to create interesting background scores that can change with gameplay. Songs can be played directly from the media library, or can be imported by using the Content Pipeline. For more information, see [Playing a Song](../howto/audio/HowTo_PlayASong.md).

## Concepts

> [!IMPORTANT]
> How to articles to follow.
## Reference

* [SoundEffect Class](xref:Microsoft.Xna.Framework.Audio.SoundEffect)

Provides a loaded sound resource.

* [SoundEffectInstance Class](xref:Microsoft.Xna.Framework.Audio.SoundEffectInstance)

Provides a single playing, paused, or stopped instance of a [SoundEffect](xref:Microsoft.Xna.Framework.Audio.SoundEffect) sound.

* [DynamicSoundEffectInstance Class](xref:Microsoft.Xna.Framework.Audio.DynamicSoundEffectInstance)

Provides properties, methods, and events for play back of the audio buffer.

* [Song Class](xref:Microsoft.Xna.Framework.Media.Song)

Provides access to a song in the song library.
---
title: Sounds Overview
description: An overview of how the MonoGame Framework provides audio playback through several core audio classes.
requireMSLicense: true
---

If your game is to use a few sound files, then the [SoundEffect](xref:Microsoft.Xna.Framework.Audio.SoundEffect), [SoundEffectInstance](xref:Microsoft.Xna.Framework.Audio.SoundEffectInstance), and [DynamicSoundEffectInstance](xref:Microsoft.Xna.Framework.Audio.DynamicSoundEffectInstance) classes will provide everything you need to play and stream audio during gameplay.

## Simple Audio Playback

The simplest way to play sounds for background music or sound effects is to use [SoundEffect](xref:Microsoft.Xna.Framework.Audio.SoundEffect) and [SoundEffectInstance](xref:Microsoft.Xna.Framework.Audio.SoundEffectInstance). Source audio files are added like any other game asset to the project. For example code, see [Playing a Sound](../../howto/audio/HowTo_PlayASound.md), [Looping a Sound](../../howto/audio/HowTo_LoopASound.md), and [Adjusting Pitch and Volume](../../howto/audio/HowTo_ChangePitchAndVolume.md). For background music, see [Playing a Song](../../howto/audio/HowTo_PlayASong.md).

## Accessing the Audio Buffer

Developers can use [DynamicSoundEffectInstance](xref:Microsoft.Xna.Framework.Audio.DynamicSoundEffectInstance) for direct access to an audio buffer. By accessing the audio buffer, developers can manipulate sound, break up large sound files into smaller data chunks, and stream sound. For example code, see [Streaming Data from a WAV File](../../howto/audio/HowTo_StreamDataFromWav.md).

## 3D Audio

The [SoundEffect](xref:Microsoft.Xna.Framework.Audio.SoundEffect) class provides the ability to place audio in a 3D space. By creating [AudioEmitter](xref:Microsoft.Xna.Framework.Audio.AudioEmitter) and [AudioListener](xref:Microsoft.Xna.Framework.Audio.AudioListener) objects, the API can position a sound in 3D, and can change the 3D position of a sound during playback. Once you create and initialize [AudioEmitter](xref:Microsoft.Xna.Framework.Audio.AudioEmitter) and [AudioListener](xref:Microsoft.Xna.Framework.Audio.AudioListener), call [SoundEffectInstance.Apply3D](xref:Microsoft.Xna.Framework.Audio.SoundEffectInstance).

## Audio Constraints

When working with multiple platforms using MonoGame, there are a few constraints around audio that you will need to keep in mind and cater for, namely:

* Mobile platforms have a maximum of 32 sounds playing simultaneously.
* Desktop platforms have a maximum of 256 sounds playing simultaneously.
* Consoles and other platforms have their own constraints, please look at the console sdk documentation for more information,

> [!IMPORTANT]
> An [InstancePlayLimitException](xref:Microsoft.Xna.Framework.Audio.InstancePlayLimitException) exception is thrown if this limit is exceeded.
## Audio Buffer Format

The `byte[]` buffer format used as a parameter for the [SoundEffect](xref:Microsoft.Xna.Framework.Audio.SoundEffect) constructor, [Microphone.GetData](xref:Microsoft.Xna.Framework.Audio.Microphone) method, and [DynamicSoundEffectInstance.SubmitBuffer](xref:Microsoft.Xna.Framework.Audio.DynamicSoundEffectInstance) method is PCM wave data. Additionally, the PCM format is interleaved and in little-endian.

The audio format has the following constraints:

* The audio channels can be mono (1) or stereo (2).
* The PCM wave file must have 16-bits per sample.
* The sample rate must be between 8,000 Hz and 48,000 Hz.
* The interleaving for stereo data is left channel to right channel.

## Songs as Background Music

Access to the media library, combined with the ability to use playlists, allows games to create interesting background scores that can change with gameplay. Songs can be played directly from the media library, or can be imported by using the Content Pipeline. For more information, see [Playing a Song](../../howto/audio/HowTo_PlayASong.md).

## Concepts

> [!IMPORTANT]
> How to articles to follow.
## Reference

* [SoundEffect Class](xref:Microsoft.Xna.Framework.Audio.SoundEffect)

Provides a loaded sound resource.

* [SoundEffectInstance Class](xref:Microsoft.Xna.Framework.Audio.SoundEffectInstance)

Provides a single playing, paused, or stopped instance of a [SoundEffect](xref:Microsoft.Xna.Framework.Audio.SoundEffect) sound.

* [DynamicSoundEffectInstance Class](xref:Microsoft.Xna.Framework.Audio.DynamicSoundEffectInstance)

Provides properties, methods, and events for play back of the audio buffer.

* [Song Class](xref:Microsoft.Xna.Framework.Media.Song)

Provides access to a song in the song library.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ The format of data in the .XNB file is tightly coupled to the MonoGame Framework

### Runtime Components

Runtime components of the Content Pipeline support loading and using the transformed game asset by your MonoGame game. These components use the [MonoGame library](../WhatIs_MonoGame_Class_Library.md), which can be extended to create custom components.
Runtime components of the Content Pipeline support loading and using the transformed game asset by your MonoGame game. These components use the [MonoGame library](../monogame_class_library/index.md), which can be extended to create custom components.

## Content Loader

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ When you include an art asset file in your MonoGame solution's content project (

The run-time components of the MonoGame Content Pipeline support the loading and use of the transformed art asset by your MonoGame.

These run-time components make use of the [MonoGame Framework Class Library](../WhatIs_MonoGame_Class_Library.md), which can be extended to create custom Content Pipeline run-time components.
These run-time components make use of the [MonoGame Framework Class Library](../monogame_class_library/index.md), which can be extended to create custom Content Pipeline run-time components.

## See Also

Expand Down
12 changes: 0 additions & 12 deletions articles/getting_to_know/whatis/content_pipeline/toc.yml

This file was deleted.

Loading

0 comments on commit f90af13

Please sign in to comment.