Skip to content

Instantly share code, notes, and snippets.

View MirzaBeig's full-sized avatar
💭
I may be slow to respond.

Mirza Beig MirzaBeig

💭
I may be slow to respond.
View GitHub Profile
@MirzaBeig
MirzaBeig / SimpleAudioGenerator.cs
Created August 15, 2024 03:52
A simple procedural audio (pure sine wave) generator for Unity, using OnAudioFilterRead().
using UnityEngine;
// MB: Simple procedural audio generator.
// Generates a pure sine wave/tone at a given frequency.
public class SimpleAudioGenerator : MonoBehaviour
{
int outputSampleRate;
const float TAU = Mathf.PI * 2.0f;