| 636 | } |
| 637 | |
| 638 | uint32_t GetDefaultFrameCount(uint32_t rate) |
| 639 | { |
| 640 | if (rate == 48000) |
| 641 | return 1024; |
| 642 | |
| 643 | if (rate == 44100) |
| 644 | return 768; |
| 645 | |
| 646 | // for generic devices, we try to calculate a conservative yet small number of frames |
| 647 | uint32_t frame_count = rate / 60; // use default count |
| 648 | float f_frame_count = frame_count / 32; // try to round it to some nice sample alignment (e.g. 16bits *2 channels) |
| 649 | float extra_percent = 1.05f; |
| 650 | return ceilf(f_frame_count * extra_percent) * 32; |
| 651 | } |
| 652 | |
| 653 | static inline const char* GetSoundName(SoundSystem* sound, SoundInstance* instance) |
| 654 | { |
no outgoing calls
no test coverage detected