CSPspEmu.Hle.Modules.audio.sceVaudio.sceVaudioChReserve C# (CSharp) Метод

sceVaudioChReserve() приватный Метод

private sceVaudioChReserve ( int SampleCount, int Frequency, int Channels ) : int
SampleCount int
Frequency int
Channels int
Результат int
        public int sceVaudioChReserve(int SampleCount, int Frequency, int Channels)
        {
            try
            {
                if (VAudioReserved)
                {
                    throw (new SceKernelException(SceKernelErrors.ERROR_BUSY));
                }

                if (PspVaudioChannel.IsReserved)
                {
                    throw (new SceKernelException(SceKernelErrors.ERROR_AUDIO_CHANNEL_ALREADY_RESERVED));
                }

                if (SampleCount != 256 && SampleCount != 1024 && SampleCount != 2048)
                {
                    throw (new SceKernelException(SceKernelErrors.ERROR_INVALID_SIZE));
                }

                if (Channels != 2)
                {
                    throw (new SceKernelException(SceKernelErrors.ERROR_INVALID_FORMAT));
                }

                VAudioReserved = true;
                PspVaudioChannel.IsReserved = true;
                PspVaudioChannel.SampleCount = SampleCount;
                PspVaudioChannel.Frequency = Frequency;
                PspVaudioChannel.NumberOfChannels = Channels;

                return 0;
            }
            catch (InvalidAudioFormatException)
            {
                throw (new SceKernelException(SceKernelErrors.ERROR_AUDIO_CHANNEL_ALREADY_RESERVED));
            }
        }