| 1 | // Copyright 2015 The Go Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style |
| 3 | // license that can be found in the LICENSE file. |
| 4 | |
| 5 | //go:build darwin || linux || windows |
| 6 | |
| 7 | package al |
| 8 | |
| 9 | // Error returns one of these error codes. |
| 10 | const ( |
| 11 | InvalidName = 0xA001 |
| 12 | InvalidEnum = 0xA002 |
| 13 | InvalidValue = 0xA003 |
| 14 | InvalidOperation = 0xA004 |
| 15 | OutOfMemory = 0xA005 |
| 16 | ) |
| 17 | |
| 18 | // Distance models. |
| 19 | const ( |
| 20 | InverseDistance = 0xD001 |
| 21 | InverseDistanceClamped = 0xD002 |
| 22 | LinearDistance = 0xD003 |
| 23 | LinearDistanceClamped = 0xD004 |
| 24 | ExponentDistance = 0xD005 |
| 25 | ExponentDistanceClamped = 0xD006 |
| 26 | ) |
| 27 | |
| 28 | // Global parameters. |
| 29 | const ( |
| 30 | paramDistanceModel = 0xD000 |
| 31 | paramDopplerFactor = 0xC000 |
| 32 | paramDopplerVelocity = 0xC001 |
| 33 | paramSpeedOfSound = 0xC003 |
| 34 | paramVendor = 0xB001 |
| 35 | paramVersion = 0xB002 |
| 36 | paramRenderer = 0xB003 |
| 37 | paramExtensions = 0xB004 |
| 38 | ) |
| 39 | |
| 40 | // Source and listener parameters. |
| 41 | const ( |
| 42 | paramGain = 0x100A |
| 43 | paramPosition = 0x1004 |
| 44 | paramVelocity = 0x1006 |
| 45 | paramOrientation = 0x100F |
| 46 | paramMinGain = 0x100D |
| 47 | paramMaxGain = 0x100E |
| 48 | paramSourceState = 0x1010 |
| 49 | paramBuffersQueued = 0x1015 |
| 50 | paramBuffersProcessed = 0x1016 |
| 51 | paramSecOffset = 0x1024 |
| 52 | paramSampleOffset = 0x1025 |
| 53 | paramByteOffset = 0x1026 |
| 54 | ) |
| 55 | |
| 56 | // A source could be in the state of initial, playing, paused or stopped. |
| 57 | const ( |
| 58 | Initial = 0x1011 |
| 59 | Playing = 0x1012 |
| 60 | Paused = 0x1013 |
| 61 | Stopped = 0x1014 |
| 62 | ) |
| 63 | |
| 64 | // Buffer parameters. |
| 65 | const ( |
| 66 | paramFreq = 0x2001 |
| 67 | paramBits = 0x2002 |
| 68 | paramChannels = 0x2003 |
| 69 | paramSize = 0x2004 |
| 70 | ) |
| 71 | |
| 72 | // Audio formats. Buffer.BufferData accepts one of these formats as the data format. |
| 73 | const ( |
| 74 | FormatMono8 = 0x1100 |
| 75 | FormatMono16 = 0x1101 |
| 76 | FormatStereo8 = 0x1102 |
| 77 | FormatStereo16 = 0x1103 |
| 78 | ) |
| 79 | |
| 80 | // CapabilityDistanceModel represents the capability of specifying a different distance |
| 81 | // model for each source. |
| 82 | const CapabilityDistanceModel = Capability(0x200) |