vadim admin

About

Username
vadim
Joined
Visits
595
Last Active
Roles
Registered, Administrator
Points
189
Badges
15
  • Re: DelayProcessor issue

    Hi,

    Attach DelayProcessor script to the object with PhotonVoiceRecorder attached. VoiceCreated message gets delivered between components of the same object only.

    You can send short messages simply by recording them in memory buffer and playback later. Such processor would be very like DelayProcessor but instead of mixing with current microphone signal it will output recorded signal only.
  • Re: opus_egpv.dll caused an Access Violation (0xc0000005)

    HI Andy,
    Can you please send application log, crash dump, reproduction steps and any other info that can help?
  • Re: Implementing Photon Voice with c++

    Hi,

    Porting c# library may be a quite big task. But luckily you've already implemented most of what Photon Voice does.
    The only missing thing is compression/decompression. Integrate Opus lib in your application. It works only with predefined set of sampling rates and consumes data only in buffers of predefined sizes. If your audio processing pipeline can meet these requirements, integration should not be hard.
  • Re: Example of cached events

    Hi,

    Ty myOptions.cache = Constants.EventCaching.AddToRoomCacheGlobal;
    Your code assigns object instead of enum to cache option and should generate an error complaining about parameter type (check it in onOperationResponse).
  • Re: Connecting to Photon Cloud from Node.js or .Net Core

    Please find javascript realtime sdk: https://www.photonengine.com/sdks#html5-javascript

    No changes required to use Photon in node.js. Take a look at the test:

    // install:
    // npm install websocket
    // run:
    // node test.js
    
    // evaluating libs with vars in current context instead of 'require'
    var util = require('util')
    var vm = require("vm");
    var fs = require("fs");
    var load = function(path, context) {
      var data = fs.readFileSync(path);
      vm.runInThisContext(data, path);
    }
    
    var WebSocketClient = require("WebSocket").client
    
    // adapter for browser websocket
    WebSocket = function (uri) {
    	console.info("============", uri);
    	var self = this;
    	this.connection = null;
    	this.socket = new WebSocketClient();
    	this.socket.on('connectFailed', function (errorDescription) {
    		self.onerror(errorDescription);
    	})
    	this.socket.on('connect', function (connection) {
    		console.info("============");
    		self.connection = connection;
    
    		connection.on('error', function (error) {
    			console.info("WS error:", error);
    			self.onerror(error);
    		});
    
    		connection.on('close', function (ev) {
    			console.info("WS close:", ev);
    			self.onclose(ev);
    		});
    
    		connection.on('message', function (message) {
    //			console.info("WS message:", message);
    			if (message.type === 'utf8') {
    				self.onmessage({data:message.utf8Data});
    			}
    			return true;
    		});
    
    		self.onopen();
    	});
    	this.socket.connect(uri);
    }
    
    WebSocket.prototype.send = function (data) {
    	if(this.connection)
    		this.connection.sendUTF(data);
    }
    
    WebSocket.prototype.close = function () {
    	if(this.connection)
    		this.connection.close();
    }
    ///////
    
    load("./Photon-Javascript_SDK.js")
    
    var AppInfo = {
    //    MasterAddress: "app-eu.exitgamescloud.com:9090",
        MasterAddress: "localhost:9090",
        AppId: "<no-app-id>",
        AppVersion: "1.0",
    }
    
    var LBC = Photon.LoadBalancing.LoadBalancingClient;
    var lbc = new LBC(AppInfo.MasterAddress, AppInfo.AppId, AppInfo.AppVersion);
    
    lbc.onStateChange = function (state) {
    	// "namespace" import for static members shorter access	
    	console.info("State:", LBC.StateToName(state));
    	switch (state) {
    		case LBC.State.JoinedLobby:
    			this.createRoom("node-");
    			break;
    		case LBC.State.Joined:
    			break;
    		default:
    			break;
    	}
    };
    
    lbc.onEvent = function (code, data) {
    	console.info("Event:", code, data);
    	lbc.raiseEvent(code, data);
    }
    
    lbc.onOperationResponse = function (errorCode, errorMsg, code, content) {
    	console.info("op resp:", errorCode, errorMsg, code, content);
    	if (errorCode) {
    		switch (code) {
    //			case Photon.LoadBalancing.Constants.OperationCode.JoinRandomGame:
    	//			break;
    			default:
    				console.error("Operation Response error:", errorCode, errorMsg, code, content);
    				break;
    		}
    	}
    };
    
    lbc.connect()