# fakeAudioOutputStream

A fake audio output stream record carrying state, sampleRate, channels, quantumFrames, renderedQuanta, and related state.

Last updated: 2026-09-09

Package: audio | Status: source-declared

Tags: audio, class, cpu, method, source-example, yeho

Play and control audio through Yeho's bounded audio runtime.

```yh
external class fakeAudioOutputStream
```

- int state: Stores state as int.
- int sampleRate: Stores sample rate as int.
- int channels: Stores channels as int.
- int quantumFrames: Stores quantum frames as int.
- int renderedQuanta: Stores rendered quanta as int.
- int renderedFrames: Stores rendered frames as int.
- int writesInQuantum: Stores writes in quantum as int.
- int failures: Stores failures as int.
- int lossAtQuantum: Stores loss at quantum as int.
- int emptyAtQuantum: Stores empty at quantum as int.
- bool emptyDelivered: Stores empty delivered as bool.
- int failPhase: Stores fail phase as int.
- float checksum: Stores checksum as float.
- fakeAudioOutputStream(int sampleRate, int quantumFrames): Fake audio output stream.
- InjectFailure(int phase): Inject failure.
- InjectDeviceLossAt(int quantum): Inject device loss at.
- InjectEmptyAt(int quantum): Inject empty at.
- ConfigureDefault() returns bool: Configure default.
- Start() returns bool: Start.
- BeginRender() returns int: Begin render.
- WriteStereoFrame(int frame, float left, float right) returns bool: Write stereo frame.
- EndRender(int frames) returns bool: End render.
- Stop() returns bool: Stop.
- Restart() returns bool: Restart.
- Destroy(): Destroy.

## Use fakeAudioOutputStream

A complete small caller. Values are illustrative; check the returned result and package requirements before connecting live resources.

Verification: type checked

```yh
using audio

// Play and control audio through Yeho's bounded audio runtime.
fakeAudioOutputStream sample = fakeAudioOutputStream(1, 1)
Console.Log(Text.From(sample.state))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.audio__fakeaudiooutputstream"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

[[dependencies]]
package = "audio"
version = "0.1.0"
path = "../../../yeho/packages/audio"

```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/audio--fakeAudioOutputStream/usage --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## fakeAudioOutputStream.InjectFailure

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using audio

// Inject failure.
fakeAudioOutputStream instance = fakeAudioOutputStream(1, 1)
int argument_phase = 1
instance.InjectFailure(argument_phase)
Console.Log("InjectFailure completed")

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.audio__fakeaudiooutputstream"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

[[dependencies]]
package = "audio"
version = "0.1.0"
path = "../../../yeho/packages/audio"

```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/audio--fakeAudioOutputStream/method-InjectFailure-14 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## fakeAudioOutputStream.InjectDeviceLossAt

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using audio

// Inject device loss at.
fakeAudioOutputStream instance = fakeAudioOutputStream(1, 1)
int argument_quantum = 1
instance.InjectDeviceLossAt(argument_quantum)
Console.Log("InjectDeviceLossAt completed")

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.audio__fakeaudiooutputstream"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

[[dependencies]]
package = "audio"
version = "0.1.0"
path = "../../../yeho/packages/audio"

```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/audio--fakeAudioOutputStream/method-InjectDeviceLossAt-15 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## fakeAudioOutputStream.InjectEmptyAt

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using audio

// Inject empty at.
fakeAudioOutputStream instance = fakeAudioOutputStream(1, 1)
int argument_quantum = 1
instance.InjectEmptyAt(argument_quantum)
Console.Log("InjectEmptyAt completed")

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.audio__fakeaudiooutputstream"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

[[dependencies]]
package = "audio"
version = "0.1.0"
path = "../../../yeho/packages/audio"

```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/audio--fakeAudioOutputStream/method-InjectEmptyAt-16 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## fakeAudioOutputStream.ConfigureDefault

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using audio

// Configure default.
fakeAudioOutputStream instance = fakeAudioOutputStream(1, 1)
bool result = instance.ConfigureDefault()
Console.Log(Text.From(result))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.audio__fakeaudiooutputstream"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

[[dependencies]]
package = "audio"
version = "0.1.0"
path = "../../../yeho/packages/audio"

```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/audio--fakeAudioOutputStream/method-ConfigureDefault-17 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## fakeAudioOutputStream.Start

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using audio

// Start.
fakeAudioOutputStream instance = fakeAudioOutputStream(1, 1)
bool result = instance.Start()
Console.Log(Text.From(result))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.audio__fakeaudiooutputstream"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

[[dependencies]]
package = "audio"
version = "0.1.0"
path = "../../../yeho/packages/audio"

```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/audio--fakeAudioOutputStream/method-Start-18 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## fakeAudioOutputStream.BeginRender

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using audio

// Begin render.
fakeAudioOutputStream instance = fakeAudioOutputStream(1, 1)
int result = instance.BeginRender()
Console.Log(Text.From(result))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.audio__fakeaudiooutputstream"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

[[dependencies]]
package = "audio"
version = "0.1.0"
path = "../../../yeho/packages/audio"

```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/audio--fakeAudioOutputStream/method-BeginRender-19 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## fakeAudioOutputStream.WriteStereoFrame

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using audio

// Write stereo frame.
fakeAudioOutputStream instance = fakeAudioOutputStream(1, 1)
int argument_frame = 1
float argument_left = 1.0
float argument_right = 1.0
bool result = instance.WriteStereoFrame(argument_frame, argument_left, argument_right)
Console.Log(Text.From(result))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.audio__fakeaudiooutputstream"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

[[dependencies]]
package = "audio"
version = "0.1.0"
path = "../../../yeho/packages/audio"

```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/audio--fakeAudioOutputStream/method-WriteStereoFrame-20 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## fakeAudioOutputStream.EndRender

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using audio

// End render.
fakeAudioOutputStream instance = fakeAudioOutputStream(1, 1)
int argument_frames = 1
bool result = instance.EndRender(argument_frames)
Console.Log(Text.From(result))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.audio__fakeaudiooutputstream"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

[[dependencies]]
package = "audio"
version = "0.1.0"
path = "../../../yeho/packages/audio"

```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/audio--fakeAudioOutputStream/method-EndRender-21 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## fakeAudioOutputStream.Stop

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using audio

// Stop.
fakeAudioOutputStream instance = fakeAudioOutputStream(1, 1)
bool result = instance.Stop()
Console.Log(Text.From(result))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.audio__fakeaudiooutputstream"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

[[dependencies]]
package = "audio"
version = "0.1.0"
path = "../../../yeho/packages/audio"

```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/audio--fakeAudioOutputStream/method-Stop-22 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## fakeAudioOutputStream.Restart

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using audio

// Restart.
fakeAudioOutputStream instance = fakeAudioOutputStream(1, 1)
bool result = instance.Restart()
Console.Log(Text.From(result))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.audio__fakeaudiooutputstream"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

[[dependencies]]
package = "audio"
version = "0.1.0"
path = "../../../yeho/packages/audio"

```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/audio--fakeAudioOutputStream/method-Restart-23 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## fakeAudioOutputStream.Destroy

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using audio

// Destroy.
fakeAudioOutputStream instance = fakeAudioOutputStream(1, 1)
instance.Destroy()
Console.Log("Destroy completed")

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.audio__fakeaudiooutputstream"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

[[dependencies]]
package = "audio"
version = "0.1.0"
path = "../../../yeho/packages/audio"

```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/audio--fakeAudioOutputStream/method-Destroy-24 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


Package presence and a declaration do not establish support on every host. Host services need their platform and lifecycle setup.

Source: yeho/packages/audio/audio.yh

AI training permission: https://demonhunterlabs.com/ai-use
