Subversion Repositories spk

Rev

Rev 326 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 326 Rev 341
Line 281... Line 281...
281
		outInfo.format = SF_FORMAT_WAV | SF_FORMAT_PCM_16;
281
		outInfo.format = SF_FORMAT_WAV | SF_FORMAT_PCM_16;
282
		SNDFILE* outputFile = sf_open(outwavefile.toStdString().c_str(), overwrite ? SFM_RDWR : SFM_WRITE, &outInfo);
282
		SNDFILE* outputFile = sf_open(outwavefile.toStdString().c_str(), overwrite ? SFM_RDWR : SFM_WRITE, &outInfo);
283
		if (outputFile)
283
		if (outputFile)
284
		{
284
		{
285
			double buffer[BUFFER_LEN];
285
			double buffer[BUFFER_LEN];
286
			size_t currentPos = 0;
286
			unsigned long long currentPos = 0;
287
 
287
 
288
			// seek to end of file
288
			// seek to end of file
289
			int check = sf_format_check(&outInfo);
289
			int check = sf_format_check(&outInfo);
290
			sf_count_t seek = sf_seek(outputFile, 0, SEEK_END);
290
			sf_count_t seek = sf_seek(outputFile, 0, SEEK_END);
291
 
291
 
Line 306... Line 306...
306
				}
306
				}
307
			}
307
			}
308
			else
308
			else
309
				currentPos += static_cast<size_t>((static_cast<double>(outInfo.frames) / static_cast<double>(outInfo.samplerate) * 1000.0) + 0.5);
309
				currentPos += static_cast<size_t>((static_cast<double>(outInfo.frames) / static_cast<double>(outInfo.samplerate) * 1000.0) + 0.5);
310
 
310
 
311
			size_t startPos = currentPos;
311
			unsigned long long startPos = currentPos;
312
 
312
 
313
			// now we need to merge the wav file
313
			// now we need to merge the wav file
314
			{
314
			{
315
				SF_INFO inInfo;
315
				SF_INFO inInfo;
316
				SNDFILE* inputFile = sf_open(mergewavfile.toFileUTF8().c_str(), SFM_READ, &inInfo);
316
				SNDFILE* inputFile = sf_open(mergewavfile.toFileUTF8().c_str(), SFM_READ, &inInfo);
Line 677... Line 677...
677
	{
677
	{
678
		Utils::WStringList addLines;
678
		Utils::WStringList addLines;
679
 
679
 
680
		// compute the current position
680
		// compute the current position
681
		double duration = static_cast<double>(info.frames) / static_cast<double>(info.samplerate);
681
		double duration = static_cast<double>(info.frames) / static_cast<double>(info.samplerate);
682
		size_t currentPos = static_cast<size_t>((duration * 1000.0) + 0.5);
682
		unsigned long long currentPos = static_cast<unsigned long long>((duration * 1000.0) + 0.5);
683
 
683
 
684
		// seek to end of file
684
		// seek to end of file
685
		int check = sf_format_check(&info);
685
		int check = sf_format_check(&info);
686
		sf_count_t seek = sf_seek(mainFile, 0, SEEK_END);
686
		sf_count_t seek = sf_seek(mainFile, 0, SEEK_END);
687
 
687
 
Line 792... Line 792...
792
	Utils::WString command = cmd.argCount() >= 1 ? cmd.arg(0) : L"";
792
	Utils::WString command = cmd.argCount() >= 1 ? cmd.arg(0) : L"";
793
	command.toLower();
793
	command.toLower();
794
 
794
 
795
	// display program header to command prompt
795
	// display program header to command prompt
796
	if(!cmd.hasSwitch(L"quiet"))
796
	if(!cmd.hasSwitch(L"quiet"))
797
		printf("\nX3 Voice Create V1.10 (SPK Library Version %.2f) 18/05/2025 Created by Cycrow\n\n", GetLibraryVersion());
797
		wprintf(L"\nX3 Voice Create V1.10 (SPK Library Version %.2f) 18/05/2025 Created by Cycrow\n\n", GetLibraryVersion());
798
 
798
 
799
	if (command == L"offset")
799
	if (command == L"offset")
800
		DoOffset(cmd);
800
		DoOffset(cmd);
801
	else if (command == L"help")
801
	else if (command == L"help")
802
		PrintSyntax(cmd.cmdName());
802
		PrintSyntax(cmd.cmdName());