diff --git a/rpcs3/Emu/Cell/Modules/cellVoice.cpp b/rpcs3/Emu/Cell/Modules/cellVoice.cpp index 8da8a74389..eb55297194 100644 --- a/rpcs3/Emu/Cell/Modules/cellVoice.cpp +++ b/rpcs3/Emu/Cell/Modules/cellVoice.cpp @@ -1,220 +1,418 @@ -#include "stdafx.h" +#include "stdafx.h" #include "Emu/System.h" +#include "Emu/IdManager.h" #include "Emu/Cell/PPUModule.h" #include "cellVoice.h" LOG_CHANNEL(cellVoice); - -s32 cellVoiceConnectIPortToOPort() +template<> +void fmt_class_string::format(std::string& out, u64 arg) { - UNIMPLEMENTED_FUNC(cellVoice); + format_enum(out, arg, [](auto error) + { + switch (error) + { + STR_CASE(CELL_VOICE_ERROR_ADDRESS_INVALID); + STR_CASE(CELL_VOICE_ERROR_ARGUMENT_INVALID); + STR_CASE(CELL_VOICE_ERROR_CONTAINER_INVALID); + STR_CASE(CELL_VOICE_ERROR_DEVICE_NOT_PRESENT); + STR_CASE(CELL_VOICE_ERROR_EVENT_DISPATCH); + STR_CASE(CELL_VOICE_ERROR_EVENT_QUEUE); + STR_CASE(CELL_VOICE_ERROR_GENERAL); + STR_CASE(CELL_VOICE_ERROR_LIBVOICE_INITIALIZED); + STR_CASE(CELL_VOICE_ERROR_LIBVOICE_NOT_INIT); + STR_CASE(CELL_VOICE_ERROR_NOT_IMPLEMENTED); + STR_CASE(CELL_VOICE_ERROR_PORT_INVALID); + STR_CASE(CELL_VOICE_ERROR_RESOURCE_INSUFFICIENT); + STR_CASE(CELL_VOICE_ERROR_SERVICE_ATTACHED); + STR_CASE(CELL_VOICE_ERROR_SERVICE_DETACHED); + STR_CASE(CELL_VOICE_ERROR_SERVICE_HANDLE); + STR_CASE(CELL_VOICE_ERROR_SERVICE_NOT_FOUND); + STR_CASE(CELL_VOICE_ERROR_SHAREDMEMORY); + STR_CASE(CELL_VOICE_ERROR_TOPOLOGY); + } + + return unknown; + }); +} + +error_code cellVoiceConnectIPortToOPort(u32 ips, u32 ops) +{ + cellVoice.todo("cellVoiceConnectIPortToOPort(ips=%d, ops=%d)", ips, ops); + + if (!g_fxo->get()->is_init) + return CELL_VOICE_ERROR_LIBVOICE_NOT_INIT; + return CELL_OK; } -s32 cellVoiceCreateNotifyEventQueue() +error_code cellVoiceCreateNotifyEventQueue(vm::ptr id, vm::ptr key) { - UNIMPLEMENTED_FUNC(cellVoice); + cellVoice.todo("cellVoiceCreateNotifyEventQueue(id=*0x%x, key=*0x%x)", id, key); + + if (!g_fxo->get()->is_init) + return CELL_VOICE_ERROR_LIBVOICE_NOT_INIT; + return CELL_OK; } -s32 cellVoiceCreatePort() +error_code cellVoiceCreatePort(vm::ptr portId, vm::cptr pArg) { - UNIMPLEMENTED_FUNC(cellVoice); + cellVoice.todo("cellVoiceCreatePort(portId=*0x%x, pArg=*0x%x)", portId, pArg); + + if (!g_fxo->get()->is_init) + return CELL_VOICE_ERROR_LIBVOICE_NOT_INIT; + + if (!pArg) + return CELL_VOICE_ERROR_ARGUMENT_INVALID; + return CELL_OK; } -s32 cellVoiceDeletePort() +error_code cellVoiceDeletePort(u32 portId) { - UNIMPLEMENTED_FUNC(cellVoice); + cellVoice.todo("cellVoiceDeletePort(portId=%d)", portId); + + if (!g_fxo->get()->is_init) + return CELL_VOICE_ERROR_LIBVOICE_NOT_INIT; + return CELL_OK; } -s32 cellVoiceDisconnectIPortFromOPort() +error_code cellVoiceDisconnectIPortFromOPort(u32 ips, u32 ops) { - UNIMPLEMENTED_FUNC(cellVoice); + cellVoice.todo("cellVoiceDisconnectIPortFromOPort(ips=%d, ops=%d)", ips, ops); + + if (!g_fxo->get()->is_init) + return CELL_VOICE_ERROR_LIBVOICE_NOT_INIT; + return CELL_OK; } -s32 cellVoiceEnd() +error_code cellVoiceEnd() { - UNIMPLEMENTED_FUNC(cellVoice); + cellVoice.todo("cellVoiceEnd()"); + + const auto manager = g_fxo->get(); + + if (!manager->is_init) + return CELL_VOICE_ERROR_LIBVOICE_NOT_INIT; + + manager->is_init = false; + return CELL_OK; } -s32 cellVoiceGetBitRate() +error_code cellVoiceGetBitRate(u32 portId, vm::ptr bitrate) { - UNIMPLEMENTED_FUNC(cellVoice); + cellVoice.todo("cellVoiceGetBitRate(portId=%d, bitrate=*0x%x)", portId, bitrate); + + if (!g_fxo->get()->is_init) + return CELL_VOICE_ERROR_LIBVOICE_NOT_INIT; + return CELL_OK; } -s32 cellVoiceGetMuteFlag() +error_code cellVoiceGetMuteFlag(u32 portId, vm::ptr bMuted) { - UNIMPLEMENTED_FUNC(cellVoice); + cellVoice.todo("cellVoiceGetMuteFlag(portId=%d, bMuted=*0x%x)", portId, bMuted); + + if (!g_fxo->get()->is_init) + return CELL_VOICE_ERROR_LIBVOICE_NOT_INIT; + return CELL_OK; } -s32 cellVoiceGetPortAttr() +error_code cellVoiceGetPortAttr(u32 portId, u32 attr, vm::ptr attrValue) { - UNIMPLEMENTED_FUNC(cellVoice); + cellVoice.todo("cellVoiceGetPortAttr(portId=%d, attr=%d, attrValue=*0x%x)", portId, attr, attrValue); + + if (!g_fxo->get()->is_init) + return CELL_VOICE_ERROR_LIBVOICE_NOT_INIT; + return CELL_OK; } -s32 cellVoiceGetPortInfo() +error_code cellVoiceGetPortInfo(u32 portId, vm::ptr pInfo) { - UNIMPLEMENTED_FUNC(cellVoice); + cellVoice.todo("cellVoiceGetPortInfo(portId=%d, pInfo=*0x%x)", portId, pInfo); + + if (!g_fxo->get()->is_init) + return CELL_VOICE_ERROR_LIBVOICE_NOT_INIT; + return CELL_OK; } -s32 cellVoiceGetSignalState() +error_code cellVoiceGetSignalState(u32 portId, u32 attr, vm::ptr attrValue) { - UNIMPLEMENTED_FUNC(cellVoice); + cellVoice.todo("cellVoiceGetSignalState(portId=%d, attr=%d, attrValue=*0x%x)", portId, attr, attrValue); + + if (!g_fxo->get()->is_init) + return CELL_VOICE_ERROR_LIBVOICE_NOT_INIT; + return CELL_OK; } -s32 cellVoiceGetVolume() +error_code cellVoiceGetVolume(u32 portId, vm::ptr volume) { - UNIMPLEMENTED_FUNC(cellVoice); + cellVoice.todo("cellVoiceGetVolume(portId=%d, volume=*0x%x)", portId, volume); + + if (!g_fxo->get()->is_init) + return CELL_VOICE_ERROR_LIBVOICE_NOT_INIT; + return CELL_OK; } -s32 cellVoiceInit() +error_code cellVoiceInit(vm::ptr pArg) { - UNIMPLEMENTED_FUNC(cellVoice); + cellVoice.todo("cellVoiceInit(pArg=*0x%x)", pArg); + + const auto manager = g_fxo->get(); + + if (manager->is_init) + return CELL_VOICE_ERROR_LIBVOICE_INITIALIZED; + + if (!pArg) + return CELL_VOICE_ERROR_ARGUMENT_INVALID; + + manager->is_init = true; + return CELL_OK; } -s32 cellVoiceInitEx() +error_code cellVoiceInitEx(vm::ptr pArg) { - UNIMPLEMENTED_FUNC(cellVoice); + cellVoice.todo("cellVoiceInitEx(pArg=*0x%x)", pArg); + + const auto manager = g_fxo->get(); + + if (manager->is_init) + return CELL_VOICE_ERROR_LIBVOICE_INITIALIZED; + + if (!pArg) + return CELL_VOICE_ERROR_ARGUMENT_INVALID; + + manager->is_init = true; + return CELL_OK; } -s32 cellVoicePausePort() +error_code cellVoicePausePort(u32 portId) { - UNIMPLEMENTED_FUNC(cellVoice); + cellVoice.todo("cellVoicePausePort(portId=%d)", portId); + + if (!g_fxo->get()->is_init) + return CELL_VOICE_ERROR_LIBVOICE_NOT_INIT; + return CELL_OK; } -s32 cellVoicePausePortAll() +error_code cellVoicePausePortAll() { - UNIMPLEMENTED_FUNC(cellVoice); + cellVoice.todo("cellVoicePausePortAll()"); + + if (!g_fxo->get()->is_init) + return CELL_VOICE_ERROR_LIBVOICE_NOT_INIT; + return CELL_OK; } -s32 cellVoiceRemoveNotifyEventQueue() +error_code cellVoiceRemoveNotifyEventQueue(u64 key) { - UNIMPLEMENTED_FUNC(cellVoice); + cellVoice.todo("cellVoiceRemoveNotifyEventQueue(key=0x%llx)", key); + + if (!g_fxo->get()->is_init) + return CELL_VOICE_ERROR_LIBVOICE_NOT_INIT; + return CELL_OK; } -s32 cellVoiceResetPort() +error_code cellVoiceResetPort(u32 portId) { - UNIMPLEMENTED_FUNC(cellVoice); + cellVoice.todo("cellVoiceResetPort(portId=%d)", portId); + + if (!g_fxo->get()->is_init) + return CELL_VOICE_ERROR_LIBVOICE_NOT_INIT; + return CELL_OK; } -s32 cellVoiceResumePort() +error_code cellVoiceResumePort(u32 portId) { - UNIMPLEMENTED_FUNC(cellVoice); + cellVoice.todo("cellVoiceResumePort(portId=%d)", portId); + + if (!g_fxo->get()->is_init) + return CELL_VOICE_ERROR_LIBVOICE_NOT_INIT; + return CELL_OK; } -s32 cellVoiceResumePortAll() +error_code cellVoiceResumePortAll() { - UNIMPLEMENTED_FUNC(cellVoice); + cellVoice.todo("cellVoiceResumePortAll()"); + + if (!g_fxo->get()->is_init) + return CELL_VOICE_ERROR_LIBVOICE_NOT_INIT; + return CELL_OK; } -s32 cellVoiceSetBitRate() +error_code cellVoiceSetBitRate(u32 portId, s32 bitrate) { - UNIMPLEMENTED_FUNC(cellVoice); + cellVoice.todo("cellVoiceSetBitRate(portId=%d, bitrate=%d)", portId, bitrate); + + if (!g_fxo->get()->is_init) + return CELL_VOICE_ERROR_LIBVOICE_NOT_INIT; + return CELL_OK; } -s32 cellVoiceSetMuteFlag() +error_code cellVoiceSetMuteFlag(u32 portId, u16 bMuted) { - UNIMPLEMENTED_FUNC(cellVoice); + cellVoice.todo("cellVoiceSetMuteFlag(portId=%d, bMuted=%d)", portId, bMuted); + + if (!g_fxo->get()->is_init) + return CELL_VOICE_ERROR_LIBVOICE_NOT_INIT; + return CELL_OK; } -s32 cellVoiceSetMuteFlagAll() +error_code cellVoiceSetMuteFlagAll(u16 bMuted) { - UNIMPLEMENTED_FUNC(cellVoice); + cellVoice.todo("cellVoiceSetMuteFlagAll(bMuted=%d)", bMuted); + + if (!g_fxo->get()->is_init) + return CELL_VOICE_ERROR_LIBVOICE_NOT_INIT; + return CELL_OK; } -s32 cellVoiceSetNotifyEventQueue() +error_code cellVoiceSetNotifyEventQueue(u64 key, u64 source) { - UNIMPLEMENTED_FUNC(cellVoice); + cellVoice.todo("cellVoiceSetNotifyEventQueue(key=0x%llx, source=%d)", key, source); + + if (!g_fxo->get()->is_init) + return CELL_VOICE_ERROR_LIBVOICE_NOT_INIT; + return CELL_OK; } -s32 cellVoiceSetPortAttr() +error_code cellVoiceSetPortAttr(u32 portId, u32 attr, vm::ptr attrValue) { - UNIMPLEMENTED_FUNC(cellVoice); + cellVoice.todo("cellVoiceSetPortAttr(portId=%d, attr=%d, attrValue=*0x%x)", portId, attr, attrValue); + + if (!g_fxo->get()->is_init) + return CELL_VOICE_ERROR_LIBVOICE_NOT_INIT; + return CELL_OK; } -s32 cellVoiceSetVolume() +error_code cellVoiceSetVolume(u32 portId, f32 volume) { - UNIMPLEMENTED_FUNC(cellVoice); + cellVoice.todo("cellVoiceSetVolume(portId=%d, volume=%f)", portId, volume); + + if (!g_fxo->get()->is_init) + return CELL_VOICE_ERROR_LIBVOICE_NOT_INIT; + return CELL_OK; } -s32 cellVoiceStart() +error_code cellVoiceStart() { - UNIMPLEMENTED_FUNC(cellVoice); + cellVoice.todo("cellVoiceStart()"); + + if (!g_fxo->get()->is_init) + return CELL_VOICE_ERROR_LIBVOICE_NOT_INIT; + return CELL_OK; } -s32 cellVoiceStartEx() +error_code cellVoiceStartEx(vm::ptr pArg) { - UNIMPLEMENTED_FUNC(cellVoice); + cellVoice.todo("cellVoiceStartEx(pArg=*0x%x)", pArg); + + if (!g_fxo->get()->is_init) + return CELL_VOICE_ERROR_LIBVOICE_NOT_INIT; + + if (!pArg) + return CELL_VOICE_ERROR_ARGUMENT_INVALID; + return CELL_OK; } -s32 cellVoiceStop() +error_code cellVoiceStop() { - UNIMPLEMENTED_FUNC(cellVoice); + cellVoice.todo("cellVoiceStop()"); + + if (!g_fxo->get()->is_init) + return CELL_VOICE_ERROR_LIBVOICE_NOT_INIT; + return CELL_OK; } -s32 cellVoiceUpdatePort() +error_code cellVoiceUpdatePort(u32 portId, vm::cptr pArg) { - UNIMPLEMENTED_FUNC(cellVoice); + cellVoice.todo("cellVoiceUpdatePort(portId=%d, pArg=*0x%x)", portId, pArg); + + if (!g_fxo->get()->is_init) + return CELL_VOICE_ERROR_LIBVOICE_NOT_INIT; + + if (!pArg) + return CELL_VOICE_ERROR_ARGUMENT_INVALID; + return CELL_OK; } -s32 cellVoiceWriteToIPort() +error_code cellVoiceWriteToIPort(u32 ips, vm::cptr data, vm::ptr size) { - UNIMPLEMENTED_FUNC(cellVoice); + cellVoice.todo("cellVoiceWriteToIPort(ips=%d, data=*0x%x, size=*0x%x)", ips, data, size); + + if (!g_fxo->get()->is_init) + return CELL_VOICE_ERROR_LIBVOICE_NOT_INIT; + return CELL_OK; } -s32 cellVoiceWriteToIPortEx() +error_code cellVoiceWriteToIPortEx(u32 ips, vm::cptr data, vm::ptr size, u32 numFrameLost) { - UNIMPLEMENTED_FUNC(cellVoice); + cellVoice.todo("cellVoiceWriteToIPortEx(ips=%d, data=*0x%x, size=*0x%x, numFrameLost=%d)", ips, data, size, numFrameLost); + + if (!g_fxo->get()->is_init) + return CELL_VOICE_ERROR_LIBVOICE_NOT_INIT; + return CELL_OK; } -s32 cellVoiceWriteToIPortEx2() +error_code cellVoiceWriteToIPortEx2(u32 ips, vm::cptr data, vm::ptr size, s16 frameGaps) { - UNIMPLEMENTED_FUNC(cellVoice); + cellVoice.todo("cellVoiceWriteToIPortEx2(ips=%d, data=*0x%x, size=*0x%x, frameGaps=%d)", ips, data, size, frameGaps); + + if (!g_fxo->get()->is_init) + return CELL_VOICE_ERROR_LIBVOICE_NOT_INIT; + return CELL_OK; } -s32 cellVoiceReadFromOPort() +error_code cellVoiceReadFromOPort(u32 ops, vm::ptr data, vm::ptr size) { - UNIMPLEMENTED_FUNC(cellVoice); + cellVoice.todo("cellVoiceReadFromOPort(ops=%d, data=*0x%x, size=*0x%x)", ops, data, size); + + if (!g_fxo->get()->is_init) + return CELL_VOICE_ERROR_LIBVOICE_NOT_INIT; + return CELL_OK; } -s32 cellVoiceDebugTopology() +error_code cellVoiceDebugTopology() { UNIMPLEMENTED_FUNC(cellVoice); - return CELL_OK; + + if (!g_fxo->get()->is_init) + return CELL_VOICE_ERROR_LIBVOICE_NOT_INIT; + + return CELL_VOICE_ERROR_NOT_IMPLEMENTED; } DECLARE(ppu_module_manager::cellVoice)("cellVoice", []() diff --git a/rpcs3/Emu/Cell/Modules/cellVoice.h b/rpcs3/Emu/Cell/Modules/cellVoice.h index 2d8edd5689..78c82f218f 100644 --- a/rpcs3/Emu/Cell/Modules/cellVoice.h +++ b/rpcs3/Emu/Cell/Modules/cellVoice.h @@ -1,12 +1,10 @@ -#pragma once - - +#pragma once // libvoice = 0x80310801 - 0x803108ff // libvoice version 100 // Error Codes -enum +enum CellVoiceError : u32 { CELL_VOICE_ERROR_ADDRESS_INVALID = 0x8031080a, CELL_VOICE_ERROR_ARGUMENT_INVALID = 0x80310805, @@ -28,30 +26,13 @@ enum CELL_VOICE_ERROR_TOPOLOGY = 0x80310807, }; -// Definitions -enum +enum CellVoiceAppType { - CELLVOICE_MAX_IN_VOICE_PORT = 32, - CELLVOICE_MAX_OUT_VOICE_PORT = 4, - CELLVOICE_GAME_1MB_MAX_IN_VOICE_PORT = 8, - CELLVOICE_GAME_1MB_MAX_OUT_VOICE_PORT = 2, - CELLVOICE_MAX_PORT = 128, - CELLVOICE_INVALID_PORT_ID = 0xff, - - CELLVOICE_PORTTYPE_NULL = -1, - CELLVOICE_PORTTYPE_IN_MIC = 0, - CELLVOICE_PORTTYPE_IN_PCMAUDIO = 1, - CELLVOICE_PORTTYPE_IN_VOICE = 2, - CELLVOICE_PORTTYPE_OUT_PCMAUDIO = 3, - CELLVOICE_PORTTYPE_OUT_VOICE = 4, - CELLVOICE_PORTTYPE_OUT_SECONDARY = 5, - - CELLVOICE_PORTSTATE_NULL = -1, - CELLVOICE_PORTSTATE_IDLE = 0, - CELLVOICE_PORTSTATE_READY = 1, - CELLVOICE_PORTSTATE_BUFFERING = 2, - CELLVOICE_PORTSTATE_RUNNING = 3, + CELLVOICE_APPTYPE_GAME_1MB = 1 << 29 +}; +enum CellVoiceBitRate +{ CELLVOICE_BITRATE_NULL = -1, CELLVOICE_BITRATE_3850 = 3850, CELLVOICE_BITRATE_4650 = 4650, @@ -60,32 +41,139 @@ enum CELLVOICE_BITRATE_14400 = 14400, CELLVOICE_BITRATE_16000 = 16000, CELLVOICE_BITRATE_22533 = 22533, +}; - CELLVOICE_SAMPLINGRATE_NULL = -1, - CELLVOICE_SAMPLINGRATE_16000 = 16000, - - CELLVOICE_EVENT_DATA_ERROR = 1 << 0, - CELLVOICE_EVENT_PORT_ATTACHED = 1 << 1, - CELLVOICE_EVENT_PORT_DETACHED = 1 << 2, - CELLVOICE_EVENT_SERVICE_ATTACHED = 1 << 3, - CELLVOICE_EVENT_SERVICE_DETACHED = 1 << 4, +enum CellVoiceEventType +{ + CELLVOICE_EVENT_DATA_ERROR = 1 << 0, + CELLVOICE_EVENT_PORT_ATTACHED = 1 << 1, + CELLVOICE_EVENT_PORT_DETACHED = 1 << 2, + CELLVOICE_EVENT_SERVICE_ATTACHED = 1 << 3, + CELLVOICE_EVENT_SERVICE_DETACHED = 1 << 4, CELLVOICE_EVENT_PORT_WEAK_ATTACHED = 1 << 5, CELLVOICE_EVENT_PORT_WEAK_DETACHED = 1 << 6, - - CELLVOICE_PCM_NULL = -1, - CELLVOICE_PCM_FLOAT = 0, - CELLVOICE_PCM_FLOAT_LITTLE_ENDIAN = 1, - CELLVOICE_PCM_SHORT = 2, - CELLVOICE_PCM_SHORT_LITTLE_ENDIAN = 3, - CELLVOICE_PCM_INTEGER = 4, - CELLVOICE_PCM_INTEGER_LITTLE_ENDIAN = 5, - - CELLVOICE_ATTR_ENERGY_LEVEL = 1000, - CELLVOICE_ATTR_VAD = 1001, - CELLVOICE_ATTR_DTX = 1002, - CELLVOICE_ATTR_AUTO_RESAMPLE = 1003, - CELLVOICE_ATTR_LATENCY = 1004, - CELLVOICE_ATTR_SILENCE_THRESHOLD = 1005, - - CELLVOICE_APPTYPE_GAME_1MB = 1 << 29 +}; + +enum CellVoicePcmDataType +{ + CELLVOICE_PCM_NULL = -1, + CELLVOICE_PCM_FLOAT = 0, + CELLVOICE_PCM_FLOAT_LITTLE_ENDIAN = 1, + CELLVOICE_PCM_SHORT = 2, + CELLVOICE_PCM_SHORT_LITTLE_ENDIAN = 3, + CELLVOICE_PCM_INTEGER = 4, + CELLVOICE_PCM_INTEGER_LITTLE_ENDIAN = 5, +}; + +enum CellVoicePortAttr +{ + CELLVOICE_ATTR_ENERGY_LEVEL = 1000, + CELLVOICE_ATTR_VAD = 1001, + CELLVOICE_ATTR_DTX = 1002, + CELLVOICE_ATTR_AUTO_RESAMPLE = 1003, + CELLVOICE_ATTR_LATENCY = 1004, + CELLVOICE_ATTR_SILENCE_THRESHOLD = 1005, +}; + +enum CellVoicePortState +{ + CELLVOICE_PORTSTATE_NULL = -1, + CELLVOICE_PORTSTATE_IDLE = 0, + CELLVOICE_PORTSTATE_READY = 1, + CELLVOICE_PORTSTATE_BUFFERING = 2, + CELLVOICE_PORTSTATE_RUNNING = 3, +}; + +enum CellVoicePortType +{ + CELLVOICE_PORTTYPE_NULL = -1, + CELLVOICE_PORTTYPE_IN_MIC = 0, + CELLVOICE_PORTTYPE_IN_PCMAUDIO = 1, + CELLVOICE_PORTTYPE_IN_VOICE = 2, + CELLVOICE_PORTTYPE_OUT_PCMAUDIO = 3, + CELLVOICE_PORTTYPE_OUT_VOICE = 4, + CELLVOICE_PORTTYPE_OUT_SECONDARY = 5, +}; + +enum CellVoiceSamplingRate +{ + CELLVOICE_SAMPLINGRATE_NULL = -1, + CELLVOICE_SAMPLINGRATE_16000 = 16000, +}; + +enum CellVoiceVersionCheck +{ + CELLVOICE_VERSION_100 = 100 +}; + +// Definitions +enum +{ + CELLVOICE_MAX_IN_VOICE_PORT = 32, + CELLVOICE_MAX_OUT_VOICE_PORT = 4, + CELLVOICE_GAME_1MB_MAX_IN_VOICE_PORT = 8, + CELLVOICE_GAME_1MB_MAX_OUT_VOICE_PORT = 2, + CELLVOICE_MAX_PORT = 128, + CELLVOICE_INVALID_PORT_ID = 0xff, +}; + +struct CellVoiceBasePortInfo // aligned(64) +{ + be_t portType; + be_t state; + be_t numEdge; + vm::bptr pEdge; + be_t numByte; + be_t frameSize; +}; + +struct CellVoiceInitParam // aligned(32) +{ + be_t eventMask; + be_t version; + be_t appType; + u8 reserved[32 - sizeof(s32) * 3]; +}; + +struct CellVoicePCMFormat +{ + u8 numChannels; + u8 sampleAlignment; + be_t dataType; + be_t sampleRate; +}; + +struct CellVoicePortParam // aligned(64) +{ + be_t portType; + be_t threshold; + be_t bMute; + be_t volume; + union + { + struct + { + be_t bitrate; + } voice; + struct + { + be_t bufSize; + CellVoicePCMFormat format; + } pcmaudio; + struct + { + be_t playerId; + } device; + }; +}; + +struct CellVoiceStartParam // aligned(32) +{ + be_t container; + u8 reserved[32 - sizeof(s32) * 1]; +}; + +struct voice_manager +{ + atomic_t is_init{ false }; };