Add audio settings information

This commit is contained in:
Lorenzooone
2024-06-23 05:19:20 +02:00
parent 65e2950970
commit 4f6998ab33
4 changed files with 16 additions and 12 deletions

View File

@@ -5,7 +5,7 @@ The main goal is to offer the ability to use the Capture Card with a TV, via ful
## Features
- Performance-focused design, with low latency for both audio and video (measured to oscillate between 1 and 2 frames).
- Performance-focused design, with low latency for both audio and video (measured to oscillate between 1 and 2 frames on 120hz displays).
- Option to split the screens in separate windows, to address them separately.
- Make your game run in fullscreen mode. If you own multiple displays, you can even use one per-window.
- Many builtin crop options for the screens.
@@ -140,4 +140,10 @@ On Windows, the profiles can be found in the ".config/cc3dsfs" folder inside the
xattr -c ./cc3dsfs.app
```
- It can also be achieved by opening a terminal, typing "xattr -c ", dragging the application to the terminal, and finally pressing Enter.
- Certain TVs/Monitors may add some audio delay for the purpose of video/lip syncing. If you're experiencing too much audio delay when using this software, try checking in the TV/Monitor settings whether you can reduce that added delay. One of the names used for that setting is "Lip Sync", or something along that line.
- For the best audio latency and quality, it may be needed to change OpenAL's sound settings. Their location is OS-specific. On linux, you may use the "alsoft-config" command. In particular, the following parameters may help:
```
frequency = 96000
periods = 2
period_size = 64
```

View File

@@ -5,9 +5,6 @@
#include <queue>
#include "audio_data.hpp"
#include "utils.hpp"
#include "audio.hpp"
#include "capture_structs.hpp"
#include "hw_defs.hpp"
struct Sample {
Sample(sf::Int16 *bytes, std::size_t size, float time);
@@ -24,6 +21,7 @@ public:
ConsumerMutex samples_wait;
Audio(AudioData *audio_data);
~Audio();
void update_volume();
void start_audio();
void stop_audio();
@@ -33,7 +31,7 @@ private:
int final_volume = -1;
bool terminate;
int num_consecutive_fast_seek;
sf::Int16 buffer[MAX_SAMPLES_IN];
sf::Int16 *buffer;
std::chrono::time_point<std::chrono::high_resolution_clock> clock_time_start;
bool onGetData(sf::SoundStream::Chunk &data) override;

View File

@@ -2,7 +2,7 @@
#define __HW_DEFS_HPP
#define AUDIO_CHANNELS 2
#define SAMPLE_RATE 48000
#define SAMPLE_RATE 96000
#define PITCH_RATE (67027964 / ((float)SAMPLE_RATE * 2048))
#define TOP_WIDTH_3DS 400

View File

@@ -17,18 +17,18 @@ Sample::Sample(sf::Int16 *bytes, std::size_t size, float time) : bytes(bytes), s
Audio::Audio(AudioData *audio_data) {
this->audio_data = audio_data;
// Consume old events
this->buffer = new sf::Int16[MAX_SAMPLES_IN];
this->audio_data->check_audio_restart_request();
sf::SoundStream::initialize(AUDIO_CHANNELS, SAMPLE_RATE);
this->setPitch(PITCH_RATE);
#if (SFML_VERSION_MAJOR > 2) || ((SFML_VERSION_MAJOR == 2) && (SFML_VERSION_MINOR >= 6))
// Since we receive data every 16.6 ms, this is useless,
// and only increases CPU load... (Default is 10 ms)
//sf::SoundStream::setProcessingInterval(sf::Time::Zero);
#endif
start_audio();
setVolume(0);
this->final_volume = 0;
}
Audio::~Audio() {
delete []this->buffer;
}
void Audio::update_volume() {
int new_final_volume = this->audio_data->get_final_volume();