Struct AudioPitch | Project Tiny | 0.32.0-preview.54
docs.unity3d.com
    Show / Hide Table of Contents

    Struct AudioPitch

    An AudioPitch component adjusts an AudioSource's pitch.

    Namespace: Unity.Tiny.Audio
    Syntax
    public struct AudioPitch : IComponentData
    Remarks

    The AudioSystem pushes updated pitch values down to the native audio code on each platform. Minimal code to play an AudioClip with a modified pitch:

        var eSource = mgr.CreateEntity();
        AudioSource source = new AudioSource();
        source.clip = eClip;
        mgr.AddComponentData(eSource, source);
        AudioPitch pitchEffect = new AudioPitch();
        pitchEffect.pitch = 2.0f;
        mgr.AddComponentData(eSource, pitchEffect);
        mgr.AddComponent(eSource, typeof(AudioSourceStart));

    Fields

    pitch

    Declaration
    public float pitch
    Field Value
    Type Description
    Single
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023